예제 #1
0
        public IEnumerable <TestReport> Run(string directory)
        {
            var ret = new List <ITest>();

            var assemblies = directoryScanner.ScanDirectory(directory);

            foreach (var assembly in assemblies)
            {
                var testClasses = assemblyScanner.GetTestsFromAssembly(assembly);

                foreach (var testClass in testClasses)
                {
                    ret.Add(testFixtureFactory.GetTestFixture(testClass));
                }
            }

            var report = new List <TestReport>();

            foreach (var fixture in ret)
            {
                fixture.Run();
                report.Add(fixture.GetReport());
            }

            return(report);
        }
예제 #2
0
        public void Return_empty_array_if_no_test_fixtures_types_in_assembly()
        {
            //Arrange
            assemblyScanner = new Core.AssemblyScanner(new TestDetector());

            //Act
            Type[] result = assemblyScanner.GetTestsFromAssembly(moduleBuilder.Assembly);

            //Assert
            Assert.Empty(result);
        }
예제 #3
0
        public void Returned_array_contains_test_fixture_type()
        {
            //Arrange
            assemblyScanner = new Core.AssemblyScanner(new TestDetector());
            var testFixtureType = CreateAssemblyWithSingleTestFixtureWithSingleTest();

            //Act
            var result = assemblyScanner.GetTestsFromAssembly(moduleBuilder.Assembly);

            //Assert
            Assert.NotNull(result);
            Assert.Single(result);
            Assert.Contains(testFixtureType, result);
        }