Esempio n. 1
0
 public void GenerateBase_ClassWithListOfModelsProperty_ShouldAddModelInListForGeneration()
 {
     var generator = new ViewModelGenerator(new ViewModelGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests", "Southpaw.Output.Tests") });
     generator.GenerateBase(typeof(ModelWithListOfModelsProperty));
     Assert.AreEqual(1, generator._nestedPropertyTypes.Count);
     Assert.AreEqual(typeof(ModelWithDateTimeProperty), generator._nestedPropertyTypes[0]);
 }
Esempio n. 2
0
 public void GenerateBase_ClassWithPropertyTypeInTheSameAssembly_ShouldRecordNestedClassForGeneration()
 {
     var generator = new ViewModelGenerator(new ViewModelGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests", "Southpaw.Output.Tests") });
     generator.GenerateBase(typeof(ModelWithNestedAssemblyPropertyType));
     Assert.Contains(typeof(TestModel), generator._nestedPropertyTypes);
 }
Esempio n. 3
0
 public void GenerateBase_ClassInheritingFromAnother_ShouldRecordNestedClassForGeneration()
 {
     var generator = new ViewModelGenerator(new ViewModelGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests", "Southpaw.Output.Tests") });
     generator.GenerateBase(typeof(ModelInheritingFromAnother));
     Assert.Contains(typeof(ModelWithDateTimeProperty), generator._nestedPropertyTypes);
 }