コード例 #1
0
        public void CanDealWithNestedNamespaces()
        {
            var builder = new TsModelBuilder();
            builder.Add<Person>();
            builder.Add<Drink>();

            var generator = new TsGenerator();
            generator.SetModuleNameFormatter(_ => "custom");//everything should go into the 'custom' module
            var model = builder.Build();
            var result = generator.Generate(model);

            var expectedOutput = @"
            declare module custom {
            interface Person {
            WhiteRussian: custom.Drink;
            AllDrinks: custom.Drink[];
            }
            }
            declare module custom {
            interface Drink {
            }
            }
            ";

            Assert.Equal(expectedOutput, result);
        }
コード例 #2
0
        public void WhenModeIsClasses_InterfacesArentGenerated()
        {
            var builder = new TsModelBuilder();

            builder.Add <Employee>();
            builder.Add <User>();
            var model = builder.Build();

            var target = new TsGenerator
            {
                Mode = TsGenerationModes.Classes
            };
            var script = target.Generate(model);

            var classCount = Regex.Matches(script, Regex.Escape("class")).Count;

            Assert.True(classCount > 0, script);

            var moduleCount = Regex.Matches(script, Regex.Escape("module")).Count;

            Assert.True(moduleCount > 0, script);

            var interfaceCount = Regex.Matches(script, Regex.Escape("interface")).Count;

            Assert.True(interfaceCount == 0, script);

            var namespaceCount = Regex.Matches(script, Regex.Escape("namespace")).Count;

            Assert.True(namespaceCount == 0, script);
        }
コード例 #3
0
        public void CanDealWithNestedNamespaces()
        {
            var builder = new TsModelBuilder();

            builder.Add <Person>();
            builder.Add <Drink>();

            var generator = new TsGenerator();

            generator.SetModuleNameFormatter(_ => "custom");//everything should go into the 'custom' module
            var model  = builder.Build();
            var result = generator.Generate(model);

            var expectedOutput = @"
declare module custom {
	interface Person {
		WhiteRussian: custom.Drink;
		AllDrinks: custom.Drink[];
	}
}
declare module custom {
	interface Drink {
	}
}
";

            Assert.Equal(expectedOutput, result);
        }
コード例 #4
0
        public void WhenGenerate_OutputIsFormated()
        {
            var builder = new TsModelBuilder();

            builder.Add <Address>();
            var model = builder.Build();

            var target = new TsGenerator();
            var script = target.Generate(model);

            using (var reader = new StringReader(script))
            {
                var line = string.Empty;
                while ((line = reader.ReadLine()) != null)
                {
                    if (line.Contains("interface Address {"))
                    {
                        Assert.StartsWith("\t", line);
                    }
                    if (line.Contains("ID: Guid"))
                    {
                        Assert.StartsWith("\t\t", line);
                    }
                }
            }
        }
コード例 #5
0
        public void WhenAddEnum_EnumIsAddedToModel()
        {
            var target = new TsModelBuilder();
            target.Add(typeof(CustomerKind));

            Assert.Single(target.Enums.Values.Where(o => o.Type == typeof(CustomerKind)));
        }
コード例 #6
0
        public void WhenAdd_AllClassesWithTsClassAttributeAreAdded()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(Product).Assembly);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Product)));
        }
コード例 #7
0
        public void WhenInterfaceIsAdded_InterfaceIsAddedAsClass()
        {
            var target = new TsModelBuilder();

            target.Add <IShippingService>(true);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(IShippingService)));
        }
コード例 #8
0
        public void WhenAdd_ClassIsAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(Address), true);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Address)));
        }
コード例 #9
0
        public void WhenAddEnum_EnumIsAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(CustomerKind));

            Assert.Single(target.Enums.Values.Where(o => o.Type == typeof(CustomerKind)));
        }
コード例 #10
0
        public void WhenAddAndClassHasBaseClass_BaseClassIsAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(Employee), false);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Employee)));
            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Person)));
        }
コード例 #11
0
        public void WhenAddClassWithReferenceAndReferenceIsIEnumerableOfCustomType_CustomTypeIsAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add <CustomTypeCollectionReference>(true);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(CustomTypeCollectionReference)));
            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Person)));
        }
コード例 #12
0
        public void WhenAddAndClassHasBaseClass_BaseClassIsAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(Employee), false);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Employee)));
            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Person)));
        }
コード例 #13
0
        public void WhenAddAndIncludeReferencesIsTrue_ReferencedClassesAreAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(Person), true);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Person)));
            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Address)));
        }
コード例 #14
0
        public void WhenAddAndIncludeReferencesIsTrue_ReferencedClassesAreAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(Person), true);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Person)));
            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Address)));
        }
コード例 #15
0
        public void WhenBuild_NoSelfReferencingEnumerableInfiniteLoop()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(IgnoredSelfReferencingEnumerableWrapper));

            // May cause infinite loop or stack overflow, if not handled correctly.
            target.Build();
        }
コード例 #16
0
        public void WhenAddClassWithReferenceAndReferenceIsIEnumerableOfCustomType_CustomTypeIsAddedToModel()
        {
            var target = new TsModelBuilder();

            target.Add<CustomTypeCollectionReference>(true);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(CustomTypeCollectionReference)));
            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Person)));
        }
コード例 #17
0
        static void Main(string[] args)
        {
            var builder = new TsModelBuilder();
            builder.Add<TestObject>();
            var model = builder.Build();
            var target = new TypeLite.AlternateGenerators.TsBackboneModelGenerator();

            target.SetTypeVisibilityFormatter((c, v) => { return true; });
            var script = target.Generate(model, TsGeneratorOutput.Properties | TsGeneratorOutput.Enums);
        }
コード例 #18
0
        public void WhenClassContainsNullableEnumProperty_ExceptionIsNotThrown()
        {
            var builder = new TsModelBuilder();
            builder.Add<Issue24Example>();

            var generator = new TsGenerator();
            var model = builder.Build();

            Assert.DoesNotThrow(() => generator.Generate(model));
        }
コード例 #19
0
        public void WhenPropertyWithDbGeometryTypeIsAnnotedWithTsIgnoreAttribute_GeneratorDoesntCrash()
        {
            var builder = new TsModelBuilder();
            builder.Add<DbGeometryTestClass>();

            var generator = new TsGenerator();
            var model = builder.Build();

            Assert.DoesNotThrow(() => generator.Generate(model));
        }
コード例 #20
0
        public void WhenClassContainsNullableAndNonNullableStruct_StructureIsIncludedInModelOnlyOnce()
        {
            var builder = new TsModelBuilder();
            builder.Add<NullableAndNonNullableContainer>();

            var generator = new TsGenerator();
            var model = builder.Build();

            Assert.Single(model.Classes.Where(o => o.Type == typeof(Structure1)));
        }
コード例 #21
0
        public void WhenClassIsReferencedAndOutputIsSetToConstants_ClassIsntInOutput()
        {
            var builder = new TsModelBuilder();
            builder.Add<Item>();
            var model = builder.Build();
            var target = new TsGenerator();
            var script = target.Generate(model, TsGeneratorOutput.Constants);

            Assert.DoesNotContain("interface Item", script);
        }
コード例 #22
0
        public void WhenBuild_ModelWithAddedClassesIsReturned()
        {
            var target = new TsModelBuilder();

            target.Add(typeof(Person), true);

            var model = target.Build();

            Assert.Equal(target.Classes.Values, model.Classes);
        }
コード例 #23
0
        public void WhenClassContainsPropertyOfSystemType_InvalidCastExceptionIsntThrown()
        {
            var builder = new TsModelBuilder();
            builder.Add<Issue15Example>();

            var generator = new TsGenerator();
            var model = builder.Build();

            Assert.DoesNotThrow(() => generator.Generate(model));
        }
コード例 #24
0
        static void Main(string[] args)
        {
            var builder = new TsModelBuilder();

            builder.Add <TestObject>();
            var model  = builder.Build();
            var target = new TypeLite.AlternateGenerators.TsBackboneModelGenerator();

            target.SetTypeVisibilityFormatter((c, v) => { return(true); });
            var script = target.Generate(model, TsGeneratorOutput.Properties | TsGeneratorOutput.Enums);
        }
コード例 #25
0
        public void PropertyIsMarkedOptional_OptionalPropertyIsGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<Address>();
            var model = builder.Build();

            var target = new TsGenerator();
            var script = target.Generate(model);

            Assert.Contains("CountryID?: number", script);
        }
コード例 #26
0
        public void DoesNotThrowNullReferenceException_WhenEnumPropertyInGenericClass()
        {
            Assert.DoesNotThrow(() => {
                var builder = new TsModelBuilder();
                builder.Add <Bob <object> >();

                var generator = new TsGenerator();
                var model     = builder.Build();
                var result    = generator.Generate(model);
            });
        }
        public void WhenClassReferencesItself_ClassIsGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<GenericWithSelfReference>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model);

            Assert.Contains("Children: TypeLite.Tests.RegressionTests.GenericWithSelfReference[]", result);
        }
コード例 #28
0
        public void WhenClassContainsNullableEnumProperty_ExceptionIsNotThrown()
        {
            var builder = new TsModelBuilder();

            builder.Add <Issue24Example>();

            var generator = new TsGenerator();
            var model     = builder.Build();

            Assert.DoesNotThrow(() => generator.Generate(model));
        }
コード例 #29
0
        public void WhenPropertyWithDbGeometryTypeIsAnnotedWithTsIgnoreAttribute_GeneratorDoesntCrash()
        {
            var builder = new TsModelBuilder();

            builder.Add <DbGeometryTestClass>();

            var generator = new TsGenerator();
            var model     = builder.Build();

            Assert.DoesNotThrow(() => generator.Generate(model));
        }
コード例 #30
0
        public void WhenClassContainsNullableAndNonNullableStruct_StructureIsIncludedInModelOnlyOnce()
        {
            var builder = new TsModelBuilder();

            builder.Add <NullableAndNonNullableContainer>();

            var generator = new TsGenerator();
            var model     = builder.Build();

            Assert.Single(model.Classes.Where(o => o.Type == typeof(Structure1)));
        }
コード例 #31
0
        public void WhenClassContainsPropertyOfSystemType_InvalidCastExceptionIsntThrown()
        {
            var builder = new TsModelBuilder();

            builder.Add <Issue15Example>();

            var generator = new TsGenerator();
            var model     = builder.Build();

            Assert.DoesNotThrow(() => generator.Generate(model));
        }
コード例 #32
0
        public void WhenAssemblyContainsEnumWithoutClass_EnumIsGeneratedInTheOutput()
        {
            var builder = new TsModelBuilder();
            builder.Add(typeof(TypeLite.Tests.AssemblyWithEnum.TestEnum).Assembly);

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model, TsGeneratorOutput.Enums);

            Assert.Contains("TestEnum", result);
        }
コード例 #33
0
        public void WhenClassIsIgnoredByAttribute_InterfaceForClassIsntGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<IgnoreTestBase>();
            var model = builder.Build();

            var target = new TsGenerator();
            var script = target.Generate(model);

            Assert.DoesNotContain("IgnoreTestBase", script);
        }
コード例 #34
0
        public void WhenModuleIsGeneratedWithFieldsOnlyOption_ModuleHasDeclareKeyword()
        {
            var builder = new TsModelBuilder();
            builder.Add<MyTestClass>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model, TsGeneratorOutput.Fields);

            Assert.Contains("declare", result);
        }
コード例 #35
0
        public void WhenModuleIsGeneratedWithEnumsOnlyOption_ModuleDoesntHaveDeclareKeyword()
        {
            var builder = new TsModelBuilder();
            builder.Add<MyTestClass>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model, TsGeneratorOutput.Enums);

            Assert.DoesNotContain("declare", result);
        }
コード例 #36
0
        public void WhenModuleDoesntContainsAnyEnums_ItIsntGeneratedWithEnumsOption()
        {
            var builder = new TsModelBuilder();
            builder.Add<MyTestClass>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model, TsGeneratorOutput.Enums);

            Assert.DoesNotContain("MyTestModule", result);
        }
コード例 #37
0
        public void WhenEnumIsGenerated_ItHasExportKeyword()
        {
            var builder = new TsModelBuilder();
            builder.Add<MyTestClass>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model, TsGeneratorOutput.Enums);

            Assert.Contains("export", result);
        }
コード例 #38
0
        public void WhenClassWithEnumReferenced_FullyQualifiedNameIsUsed()
        {
            var builder = new TsModelBuilder();

            builder.Add <Item>();
            var model  = builder.Build();
            var target = new TsGenerator();
            var script = target.Generate(model);

            Assert.Contains("Type: TypeLitePlus.Tests.NetCore.TestModels.ItemType", script);
        }
コード例 #39
0
        public void WhenClassIsReferencedAndOutputIsSetToConstants_EnumIsntInOutput()
        {
            var builder = new TsModelBuilder();

            builder.Add <Item>();
            var model  = builder.Build();
            var target = new TsGenerator();
            var script = target.Generate(model, TsGeneratorOutput.Constants);

            Assert.DoesNotContain("enum ItemType", script);
        }
コード例 #40
0
        public void WhenEnumIsReferencedAndOutputIsSetToFields_ConstantIsntInOutput()
        {
            var builder = new TsModelBuilder();

            builder.Add <Item>();
            var model  = builder.Build();
            var target = new TsGenerator();
            var script = target.Generate(model, TsGeneratorOutput.Fields);

            Assert.DoesNotContain("MaxItems", script);
        }
コード例 #41
0
        public void WhenClassIsReferencedAndOutputIsSetToEnums_ClassIsntInOutput()
        {
            var builder = new TsModelBuilder();

            builder.Add <Item>();
            var model  = builder.Build();
            var target = new TsGenerator();
            var script = target.Generate(model, TsGeneratorOutput.Enums);

            Assert.DoesNotContain("interface Item", script);
        }
コード例 #42
0
        public void WhenDateTimePropertyIsInModel_DateWithUppercaseDIsGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<ModelWithDateTime>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model);

            Assert.Contains("Property: Date", result);
        }
        public void WhenEnumTypeAppearsOnlyInCollectionTypeProperty_EnumIsGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<AuthenticationResult>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model);

            Assert.True(model.Enums.Count == 1);
            Assert.True(model.Enums.Single().Type == typeof(AuthenticationError));
        }
コード例 #44
0
        public void WhenBaseClassIsIgnoredByAttribute_InterfaceForClassIsntGenerated()
        {
            var builder = new TsModelBuilder();

            builder.Add <IgnoreTest>();
            var model = builder.Build();

            var target = new TsGenerator();
            var script = target.Generate(model);

            Assert.DoesNotContain("interface IgnoreTestBase", script);
        }
コード例 #45
0
        public void WhenInterfaceIsAdded_InterfaceIsInOutput()
        {
            var builder = new TsModelBuilder();

            builder.Add <IShippingService>();
            var model  = builder.Build();
            var target = new TsGenerator();
            var script = target.Generate(model, TsGeneratorOutput.Properties);

            Assert.Contains("IShippingService", script);
            Assert.Contains("Price", script);
        }
コード例 #46
0
        public void PropertyIsMarkedOptional_OptionalPropertyIsGenerated()
        {
            var builder = new TsModelBuilder();

            builder.Add <Address>();
            var model = builder.Build();

            var target = new TsGenerator();
            var script = target.Generate(model);

            Assert.Contains("CountryID?: number", script);
        }
コード例 #47
0
        public void WhenClassIsReferenced_FullyQualifiedNameIsUsed()
        {
            var builder = new TsModelBuilder();

            builder.Add <Person>();
            var model  = builder.Build();
            var target = new TsGenerator();
            var script = target.Generate(model);

            Assert.Contains("PrimaryAddress: TypeLitePlus.Tests.NetCore.TestModels.Address", script);
            Assert.Contains("Addresses: TypeLitePlus.Tests.NetCore.TestModels.Address[]", script);
        }
コード例 #48
0
        public void WhenModuleIsGeneratedWithConstantsOnlyOption_ModuleDoesntHaveDeclareKeyword()
        {
            var builder = new TsModelBuilder();

            builder.Add <MyTestClass>();

            var generator = new TsGenerator();
            var model     = builder.Build();
            var result    = generator.Generate(model, TsGeneratorOutput.Constants);

            Assert.DoesNotContain("declare", result);
        }
コード例 #49
0
        public void WhenModuleIsGeneratedWithFieldsOnlyOption_ModuleHasDeclareKeyword()
        {
            var builder = new TsModelBuilder();

            builder.Add <MyTestClass>();

            var generator = new TsGenerator();
            var model     = builder.Build();
            var result    = generator.Generate(model, TsGeneratorOutput.Fields);

            Assert.Contains("declare", result);
        }
コード例 #50
0
        public void WhenDateTimePropertyIsInModel_DateWithUppercaseDIsGenerated()
        {
            var builder = new TsModelBuilder();

            builder.Add <ModelWithDateTime>();

            var generator = new TsGenerator();
            var model     = builder.Build();
            var result    = generator.Generate(model);

            Assert.Contains("Property: Date", result);
        }
コード例 #51
0
        public void WhenAssemblyContainsEnumWithoutClass_EnumIsGeneratedInTheOutput()
        {
            var builder = new TsModelBuilder();

            builder.Add(typeof(TypeLite.Tests.AssemblyWithEnum.TestEnum).Assembly);

            var generator = new TsGenerator();
            var model     = builder.Build();
            var result    = generator.Generate(model, TsGeneratorOutput.Enums);

            Assert.Contains("TestEnum", result);
        }
コード例 #52
0
        public void WhenClassIsIgnored_InterfaceForClassIsntGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<Address>();
            var model = builder.Build();
            model.Classes.Where(o => o.Name == "Address").Single().IsIgnored = true;

            var target = new TsGenerator();
            var script = target.Generate(model);

            Assert.DoesNotContain("Address", script);
        }
コード例 #53
0
        public void WhenModuleIsGeneratedWithConstantsAndProperties_ThrowsInvalidOperationException()
        {
            var builder = new TsModelBuilder();
            builder.Add<MyTestClass>();

            var generator = new TsGenerator();
            var model = builder.Build();
            Assert.Throws<InvalidOperationException>(() =>
            {
                generator.Generate(model, TsGeneratorOutput.Constants | TsGeneratorOutput.Properties);
            });
        }
コード例 #54
0
        public void WhenRunVisitor_VisitEnumIsCalledForEnumsOfModel()
        {
            var visitor = new Mock<TsModelVisitor>();
            visitor.Setup(o => o.VisitEnum(It.Is<TsEnum>(c => c.Type == typeof(ContactType)))).Verifiable();

            var builder = new TsModelBuilder();
            builder.Add(typeof(Address), true);

            var target = builder.Build();
            target.RunVisitor(visitor.Object);

            visitor.VerifyAll();
        }
コード例 #55
0
        public void WhenClassHasNullableStructure_StructureIsAddedToModel()
        {
            var builder = new TsModelBuilder();
            builder.Add<NullableStructureContainer>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model);

            Assert.Contains("NullableStructure: TypeLite.Tests.RegressionTests.Structure1;", result);
            Assert.Contains("NullableStructureCollection: TypeLite.Tests.RegressionTests.Structure2[];", result);
            Assert.Contains("NullableInt: number;", result);
        }
コード例 #56
0
        public void WhenRunVisitor_VisitClassIsCalledForClassesOfModel()
        {
            var visitor = new Mock<TsModelVisitor>();
            visitor.Setup(o => o.VisitClass(It.Is<TsClass>(c => c.Type == typeof(Person)))).Verifiable();
            visitor.Setup(o => o.VisitClass(It.Is<TsClass>(c => c.Type == typeof(Address)))).Verifiable();

            var builder = new TsModelBuilder();
            builder.Add(typeof(Person), true);

            var target = builder.Build();
            target.RunVisitor(visitor.Object);

            visitor.VerifyAll();
        }
        public void WhenClosedGenericTypeAppearsAsPropertyTypeMultipleTimes_OnlyOneInterfaceGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<GenericPropertiesBug>();

            var generator = new TsGenerator();
            var model = builder.Build();

            var result = generator.Generate(model);

            Assert.True(result.IndexOf("interface KeyValuePair") > -1, "KeyValuePair interface missing");
            Assert.True(result.IndexOf("interface KeyValuePair") == result.LastIndexOf("interface KeyValuePair"), "KeyValuePair interface generated too many times");

            Assert.True(result.Contains("Test1: System.Collections.Generic.KeyValuePair"));
            Assert.True(result.Contains("Test2: System.Collections.Generic.KeyValuePair"));
        }
コード例 #58
0
        public void CanUseCustomFormatter()
        {
            var builder = new TsModelBuilder();
            builder.Add<Drink>();

            var generator = new TsGenerator();
            generator.SetModuleNameFormatter(_ => "custom");//everything should go into the 'custom' module
            var model = builder.Build();
            var result = generator.Generate(model);

            var expectedOutput = @"
            declare module custom {
            interface Drink {
            }
            }
            ";

            Assert.Equal(expectedOutput, result);
        }
コード例 #59
0
        public void WhenArrayOfArrayEncountered_ArrayOfArrayTypeScriptTypeGenerated()
        {
            var builder = new TsModelBuilder();
            builder.Add<TestClass>();

            var generator = new TsGenerator();
            var model = builder.Build();
            var result = generator.Generate(model);

            Assert.Contains("MyStringProperty: string;", result);
            Assert.Contains("MyArray: string[];", result);
            Assert.Contains("MyJaggedArray: string[][];", result);
            Assert.Contains("MyVeryJaggedArray: string[][][];", result);
            Assert.Contains("MyIEnumerableOfString: string[];", result);
            Assert.Contains("MyListOfString: string[];", result);

            Assert.Contains("MyListOfStringArrays: string[][];", result);
            Assert.Contains("MyListOfIEnumerableOfString: string[][];", result);
            Assert.Contains("MyListOfListOfStringArray: string[][][];", result);
        }
コード例 #60
0
        public void WhenAdd_AllClassesWithTsClassAttributeAreAdded()
        {
            var target = new TsModelBuilder();
            target.Add(typeof(Product).Assembly);

            Assert.Single(target.Classes.Values.Where(o => o.Type == typeof(Product)));
        }