public void GetTypes_FriendlyAssemblyGiven_ShouldReturnInternalTypes()
        {
            var assembly = typeof(TestAssembly.AbstractClass).Assembly;

            testee = AssemblyTraverser.Create(assembly, "UnitTestGenerator.Tests");
            var result = testee.GetTypes();

            result.Should().Contain(typeof(TestAssembly.InternalClass));
        }
Exemplo n.º 2
0
        public void GetTypes_FriendlyAssemblyGiven_ShouldReturnInternalTypes()
        {
            var assembly = typeof(TestAssembly.AbstractClass).Assembly;

            testee = AssemblyTraverser.Create(assembly, "UnitTestGenerator.Tests");
            var result = testee.GetTypes();

            result.Should().Contain(typeof(TestAssembly.InternalClass));
        }
        public void Exclude_TypeGiven_ShouldBeExcluded()
        {
            var assembly = typeof(TestAssembly.AbstractClass).Assembly;
            var typeToExclude = typeof(TestAssembly.ClassContructor);

            testee = AssemblyTraverser.Create(assembly, "UnitTestGenerator.Tests");
            IAssemblyTraverserConfigurator configurator = testee;
            configurator.Exclude(new[] { typeToExclude });
            var result = testee.GetTypes();

            result.Should().NotContain(typeToExclude);
        }
        public void GetTypes_UnfriendlyAssemblyGiven_ShouldNotReturnInternalTypes()
        {
            var assembly = typeof(TestAssembly.AbstractClass).Assembly;

            testee = AssemblyTraverser.Create(assembly, "Fake");
            var result = testee.GetTypes();

            result.Should().Contain(typeof(TestAssembly.PublicClass));
            result.Should().NotContain(typeof(TestAssembly.InternalClass));
            result.Should().NotContain(typeof(TestAssembly.AbstractClass));
            result.Should().NotContain(typeof(TestAssembly.NestedClasses.NestedPublicClass));
            result.Should().NotContain(typeof(TestAssembly.GenericClass<>));
        }
Exemplo n.º 5
0
        public void Exclude_TypeGiven_ShouldBeExcluded()
        {
            var assembly      = typeof(TestAssembly.AbstractClass).Assembly;
            var typeToExclude = typeof(TestAssembly.ClassContructor);

            testee = AssemblyTraverser.Create(assembly, "UnitTestGenerator.Tests");
            IAssemblyTraverserConfigurator configurator = testee;

            configurator.Exclude(new[] { typeToExclude });
            var result = testee.GetTypes();

            result.Should().NotContain(typeToExclude);
        }
Exemplo n.º 6
0
        public void GetTypes_UnfriendlyAssemblyGiven_ShouldNotReturnInternalTypes()
        {
            var assembly = typeof(TestAssembly.AbstractClass).Assembly;

            testee = AssemblyTraverser.Create(assembly, "Fake");
            var result = testee.GetTypes();

            result.Should().Contain(typeof(TestAssembly.PublicClass));
            result.Should().NotContain(typeof(TestAssembly.InternalClass));
            result.Should().NotContain(typeof(TestAssembly.AbstractClass));
            result.Should().NotContain(typeof(TestAssembly.NestedClasses.NestedPublicClass));
            result.Should().NotContain(typeof(TestAssembly.GenericClass <>));
        }