public void Arrays() { Assert.AreEqual("System.String[]", Cd2Cd.GetTypeName(typeof(string[]))); }
public void NestedGeneric1() { Assert.AreEqual("Tests.Name.MyTest3<System.String>.MyTest4<System.Int32>", Cd2Cd.GetTypeName(typeof(MyTest3 <string> .MyTest4 <int>))); }
public void Lists() { Assert.AreEqual("System.Collections.Generic.List<System.String>", Cd2Cd.GetTypeName(typeof(List <string>))); }
public void NestedClass() { Assert.AreEqual("Tests.Name.ClassNameTests.MyTest2", Cd2Cd.GetTypeName(typeof(MyTest2))); }
public void SimpleGeneric() { Assert.AreEqual("Tests.Name.MyTest3<System.String>", Cd2Cd.GetTypeName(typeof(MyTest3 <string>))); }
public void TestFromJsonWithEnumAsByte() { Assert.AreEqual("new Tests.New.GenericField<Tests.New.AnEnum>\n{\nValll = (Tests.New.AnEnum)1\n}", Cd2Cd.GenerateFromJson <GenericField <AnEnum> >("{\"Valll\":1}")); }
public void SmokeTest() { Assert.AreEqual("Tests.Name.MyTest1", Cd2Cd.GetTypeName(typeof(MyTest1))); }
public void TestFromJsonWithNull() { Assert.AreEqual("new Tests.New.GenericField<System.Nullable<System.Int32>>\n{\nValll = null\n}", Cd2Cd.GenerateFromJson <GenericField <int?> >("{\"Valll\":null}")); }
public void TestFromJsonWithIEnumerable() { Assert.AreEqual("new Tests.New.GenericField<System.Collections.Generic.IEnumerable<System.Int32>>\n{\nValll = new System.Collections.Generic.List<System.Int32>\n{\n5\n}\n}", Cd2Cd.GenerateFromJson <GenericField <IEnumerable <int> > >("{\"Valll\":[5]}")); }
public void TestGenericField2() { Assert.AreEqual("new Tests.New.GenericField<System.Nullable<System.Int32>>\n{\nValll = 5\n}", Cd2Cd.Generate(new GenericField <int?> { Valll = 5 })); }
public void ClassEnumerablePropArray() { Assert.AreEqual("new Tests.New.ClassEnumerableProp1\n{\nVal = new System.String[]\n{\n\"aaa\"\n}\n}", Cd2Cd.Generate(new ClassEnumerableProp1 { Val = new string[] { "aaa" } })); }
public void ClassEnumerablePropList() { Assert.AreEqual("new Tests.New.ClassEnumerableProp1\n{\nVal = new System.Collections.Generic.List<System.String>\n{\n\"aaa\"\n}\n}", Cd2Cd.Generate(new ClassEnumerableProp1 { Val = new List <string> { "aaa" } })); }
public void Test2Props() { Assert.AreEqual("new Tests.New.Class2Props\n{\nStr = \"aaa\",\nInt = 5\n}", Cd2Cd.Generate(new Class2Props { Str = "aaa", Int = 5 })); }
public void TestStringProp() { Assert.AreEqual("new Tests.New.ClassStringProp\n{\nStr = \"aaa\"\n}", Cd2Cd.Generate(new ClassStringProp { Str = "aaa" })); }