public void Returns_Method1_with_information_about_test_calling_it() { TestFinder finder = new TestFinder(); IEnumerable<MethodUsage> usages = finder.FindUsagesViaTests(assemblyTwo.Path); var methodUsages = usages.Single(x => x.MethodName == "Method1" && x.ClassName == "Class1"); Assert.That(methodUsages.TestCoverage.First().MethodName, Is.EqualTo("Method1Test")); }
public void Returns_both_unit_tests_for_single_usage() { TestFinder finder = new TestFinder(); IEnumerable<MethodUsage> usages = finder.FindUsagesViaTests(assemblyThree.Path); var methodUsages = usages.Single(x => x.MethodName == "Method1" && x.ClassName == "Class1"); Assert.That(methodUsages.TestCoverage.Count(), Is.EqualTo(2)); }
public void Path_and_assembly_name_set_correctly_on_test_objects() { TestFinder finder = new TestFinder(); IEnumerable<MethodUsage> usages = finder.FindUsagesViaTests(assemblyTwo.Path); var methodUsages = usages.Single(x => x.MethodName == "Method1" && x.ClassName == "Class1"); Assert.That(methodUsages.TestCoverage.First().AssemblyName, Is.EqualTo("TestAssembly1.Tests")); Assert.That(methodUsages.TestCoverage.First().PathToAssembly, Is.EqualTo(Path.GetDirectoryName(Path.GetTempPath()))); }
public void Returns_Method1_as_a_method_used_by_the_test() { TestFinder finder = new TestFinder(); IEnumerable<MethodUsage> usages = finder.FindUsagesViaTests(assemblyTwo.Path); Assert.IsNotNull(usages.Where(x=>x.MethodName == "Method1" && x.ClassName == "Class1")); }
private TestExecutionResults ProcessNewlyBuiltAssembly() { AssemblyDiffer differ = new AssemblyDiffer(); var findModifiedMethods = differ.FindModifiedMethods(oldAssembly, newAssembly); TestFinder finder = new TestFinder(); var findUsagesViaTests = finder.FindUsagesViaTests(testAssembly); ChangedMethodsFilter filter = new ChangedMethodsFilter(); var findUnitTestsAffectedByChanges = filter.FindUnitTestsAffectedByChanges(findModifiedMethods, findUsagesViaTests); GallioTestRunner runner = new GallioTestRunner(); var testExecutionResults = runner.Execute(findUnitTestsAffectedByChanges); MoveAssemblyToOld(oldOutDir, outDir); return testExecutionResults; }