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); }
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); }
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); }