public void NewtonsoftJson_NamingStratNone_NoOverride_NameIsNotConverted() { WorkspaceBuilder.ProcessorSettings.NamingStrategy = NamingStrategy.Create(NamingStrategyType.None); TestClassBuilder builder = AddExtractedClass("MyType"); builder.AddPropertyAndBuildAttributes("PropName", "string") .AddAttribute(KnownTypes.NewtonsoftJsonPropertyName_v12) .Commit(); builder.Commit(); AssertClassScriptTextIs(@" /** */ export interface MyType { /** */ PropName: string; }"); }
public void DefaultCamelCase_PropNamesAreConverted() { WorkspaceBuilder.ProcessorSettings.NamingStrategy = NamingStrategy.Create(NamingStrategyType.Camel); TestClassBuilder builder = AddExtractedClass("MyType"); builder.AddPropertyAndBuildAttributes("PropName", "string") .AddAttribute(KnownTypes.NewtonsoftJsonPropertyName_v12) .Commit(); builder.Commit(); AssertClassScriptTextIs(@" /** */ export interface MyType { /** */ propName: string; }"); }
public void NewtonsoftJson_NameIsConverted() { TestClassBuilder builder = AddExtractedClass("MyType"); builder.AddPropertyAndBuildAttributes("PropName", "string") .AddAttribute(KnownTypes.NewtonsoftJsonPropertyName_v12) .AddNamedArg("PropertyName", "\"name\"") .Commit(); builder.Commit(); AssertClassScriptTextIs(@" /** */ export interface MyType { /** */ name: string; }"); }