コード例 #1
0
ファイル: TestFinderTests.cs プロジェクト: BenHall/Seacrest
 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"));
 }
コード例 #2
0
ファイル: TestFinderTests.cs プロジェクト: BenHall/Seacrest
 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));
 }
コード例 #3
0
ファイル: TestFinderTests.cs プロジェクト: BenHall/Seacrest
 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())));
 }
コード例 #4
0
ファイル: TestFinderTests.cs プロジェクト: BenHall/Seacrest
 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"));
 }
コード例 #5
0
ファイル: CoreApp.cs プロジェクト: BenHall/Seacrest
        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;
        }