-
Notifications
You must be signed in to change notification settings - Fork 76
/
SpecificTestCases.OverridenNamesNotCamelCased.cs
48 lines (42 loc) · 1.33 KB
/
SpecificTestCases.OverridenNamesNotCamelCased.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using Reinforced.Typings.Attributes;
using Reinforced.Typings.Fluent;
using Xunit;
namespace Reinforced.Typings.Tests.SpecificCases
{
public class TestOverrides
{
[TsProperty(Name = "ID", ForceNullable = true)]
public virtual int _id { get { return 0; } }
[TsFunction(Name = "DO_DOMETHING")]
public void DoSomething() { }
public void AnotherMethod() { }
public string AnotherProeprty { get; set; }
}
public partial class SpecificTestCases
{
[Fact]
public void OverridenNamesNotCamelCased()
{
const string result = @"
module Reinforced.Typings.Tests.SpecificCases {
export interface ITestOverrides
{
Another_Property: string;
ID?: number;
Another_Method() : void;
DO_DOMETHING() : void;
}
}";
AssertConfiguration(s =>
{
s.Global(a => a.DontWriteWarningComment().CamelCaseForMethods().CamelCaseForProperties().ReorderMembers());
s.ExportAsInterface<TestOverrides>()
.WithPublicProperties()
.WithPublicMethods()
.WithMethod(x => x.AnotherMethod(), x => x.OverrideName("Another_Method"))
.WithProperty(x => x.AnotherProeprty, x => x.OverrideName("Another_Property"))
;
}, result);
}
}
}