GetTestsFromExecutable() public method

public GetTestsFromExecutable ( string executable ) : IList
executable string
return IList
Beispiel #1
0
        public void GetTestsFromExecutable_WithoutPathExtension_ProducesWarning()
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.PathExtensionTestsExe);

            testCases.Count.Should().Be(0);
            MockLogger.Verify(l => l.LogWarning(It.Is <string>(s => s.StartsWith("Could not list test cases of executable"))));
        }
Beispiel #2
0
        public void GetTestsFromExecutable_WithPathExtension_FindsTestsWithLocation()
        {
            MockOptions.Setup(o => o.PathExtension).Returns(SettingsWrapper.ExecutableDirPlaceholder + @"\..\lib");

            var discoverer             = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.PathExtensionTestsExe);

            testCases.Count.Should().Be(TestResources.NrOfPathExtensionTests);
        }
        public void GetTestsFromExecutable_WithPathExtension_FindsTestsWithLocation()
        {
            MockOptions.Setup(o => o.PathExtension).Returns(PathExtensionTestsDllDir);

            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase>     testCases  = discoverer.GetTestsFromExecutable(PathExtensionTestsExe);

            Assert.AreEqual(72, testCases.Count);
        }
        public void GetTestsFromExecutable_WithPathExtension_FindsTestsWithLocation()
        {
            MockOptions.Setup(o => o.PathExtension).Returns(TestResources.PathExtensionTestsDllDir);

            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase>     testCases  = discoverer.GetTestsFromExecutable(TestResources.PathExtensionTestsExe);

            testCases.Count.Should().Be(TestResources.NrOfSampleTests);
        }
        // ReSharper disable once UnusedParameter.Local
        private void AssertFindsParameterizedTest(string fullyQualifiedName, Regex displayNameRegex)
        {
            Assert.IsTrue(File.Exists(SampleTests), "Build SampleTests in Debug mode before executing this test");

            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase>     tests      = discoverer.GetTestsFromExecutable(SampleTests);

            TestCase testCase = tests.Where(t => t.FullyQualifiedName == fullyQualifiedName).Single();

            Assert.IsTrue(displayNameRegex.IsMatch(testCase.DisplayName));
        }
Beispiel #6
0
        public void GetTestsFromExecubable_TestDiscoveryParam_TestsFoundWithAdditionalDiscoveryParam()
        {
            MockOptions.Setup(o => o.AdditionalTestDiscoveryParam).Returns("-testDiscoveryFlag");

            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.TestDiscoveryParamExe);

            testCases.Count.Should().Be(2);
            testCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestFails");
            testCases.Should().Contain(t => t.FullyQualifiedName == "TestDiscovery.TestPasses");
        }
        // ReSharper disable once UnusedParameter.Local
        private void AssertFindsTest(string fullyQualifiedName, Regex displayNameRegex)
        {
            TestResources.Tests_DebugX86.AsFileInfo()
            .Should().Exist("building the SampleTests solution produces that executable");

            var discoverer         = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> tests = discoverer.GetTestsFromExecutable(TestResources.Tests_DebugX86);

            TestCase testCase = tests.Single(t => t.FullyQualifiedName == fullyQualifiedName);

            testCase.DisplayName.Should().MatchRegex(displayNameRegex.ToString());
        }
Beispiel #8
0
        // ReSharper disable once UnusedParameter.Local
        private void AssertFindsParameterizedTest(string fullyQualifiedName, Regex displayNameRegex)
        {
            File.Exists(TestResources.SampleTests)
            .Should()
            .BeTrue("Build SampleTests in Debug mode before executing this test");

            var discoverer         = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase> tests = discoverer.GetTestsFromExecutable(TestResources.SampleTests);

            TestCase testCase = tests.Single(t => t.FullyQualifiedName == fullyQualifiedName);

            displayNameRegex.IsMatch(testCase.DisplayName).Should().BeTrue();
        }
        public void GetTestsFromExecutable_LoadTests_AllTestsAreFound()
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.LoadTests_ReleaseX86);

            testCases.Count.Should().Be(5000);
            for (int i = 0; i < 5000; i++)
            {
                string fullyQualifiedName = $"LoadTests.Test/{i}";
                bool   contains           = testCases.Any(tc => tc.FullyQualifiedName == fullyQualifiedName);
                contains.Should().BeTrue($" Test not found: {fullyQualifiedName}");
            }
        }
Beispiel #10
0
        private void FindSampleTests(string location)
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(location);

            testCases.Count.Should().Be(TestResources.NrOfSampleTests);

            TestCase testCase =
                testCases.Single(tc => tc.FullyQualifiedName == "Arr/TypeParameterizedTests/1.CanDefeatMath");

            testCase.DisplayName.Should().Be("Arr/TypeParameterizedTests/1.CanDefeatMath<MyStrangeArray>");
            testCase.CodeFilePath.Should().EndWith(@"sampletests\tests\typeparameterizedtests.cpp");
            testCase.LineNumber.Should().Be(53);
        }
        private void FindSampleTests(string location)
        {
            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase>     testCases  = discoverer.GetTestsFromExecutable(location);

            Assert.AreEqual(72, testCases.Count);

            TestCase testCase =
                testCases.Single(tc => tc.FullyQualifiedName == "Arr/TypeParameterizedTests/1.CanDefeatMath");

            Assert.AreEqual("Arr/TypeParameterizedTests/1.CanDefeatMath<MyStrangeArray>", testCase.DisplayName);
            Assert.IsTrue(testCase.CodeFilePath.EndsWith(@"sampletests\tests\typeparameterizedtests.cpp"));
            Assert.AreEqual(53, testCase.LineNumber);
        }
        private void FindExternallyLinkedTests(string location)
        {
            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase>     testCases  = discoverer.GetTestsFromExecutable(location);

            Assert.AreEqual(2, testCases.Count);

            Assert.AreEqual("BarTest.MethodBarDoesAbc", testCases[0].DisplayName);
            Assert.AreEqual(@"c:\prod\gtest-1.7.0\externalgoogletestlibrary\externalgoogletestlibrarytests.cpp", testCases[0].CodeFilePath);
            Assert.AreEqual(36, testCases[0].LineNumber);

            Assert.AreEqual("BarTest.DoesXyz", testCases[1].DisplayName);
            Assert.AreEqual(@"c:\prod\gtest-1.7.0\externalgoogletestlibrary\externalgoogletestlibrarytests.cpp", testCases[1].CodeFilePath);
            Assert.AreEqual(44, testCases[1].LineNumber);
        }
Beispiel #13
0
        public void GetTestsFromExecutable_LoadTests_AreFoundInReasonableTime()
        {
            var stopwatch              = Stopwatch.StartNew();
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.LoadTests);

            stopwatch.Stop();
            var actualDuration = stopwatch.Elapsed;

            int testParsingDurationInMs = CiSupport.GetWeightedDuration(0.5 * testCases.Count); // .5ms per test (discovery and processing)
            int overheadInMs            = CiSupport.GetWeightedDuration(1000);                  // pretty much arbitrary - let's see...
            var maxDuration             = TimeSpan.FromMilliseconds(testParsingDurationInMs + overheadInMs);

            actualDuration.Should().BeLessThan(maxDuration);
        }
        public void GetTestsFromExecutable_Tests_TestNamesBeingPrefixesAreFoundWithCorrectSourceLocation()
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.Tests_ReleaseX86);

            var abcdTest = testCases.Single(tc => tc.DisplayName == "abcd.t");

            abcdTest.LineNumber.Should().Be(156);
            var bbcdTest = testCases.Single(tc => tc.DisplayName == "bbcd.t");

            bbcdTest.LineNumber.Should().Be(161);
            var bcdTest = testCases.Single(tc => tc.DisplayName == "bcd.t");

            bcdTest.LineNumber.Should().Be(166);
        }
Beispiel #15
0
        private void FindExternallyLinkedTests(string location)
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(location);

            testCases.Count.Should().Be(2);

            testCases[0].DisplayName.Should().Be("BarTest.MethodBarDoesAbc");
            testCases[0].CodeFilePath.Should().Be(@"c:\prod\gtest-1.7.0\externalgoogletestlibrary\externalgoogletestlibrarytests.cpp");
            testCases[0].LineNumber.Should().Be(36);

            testCases[1].DisplayName.Should().Be("BarTest.DoesXyz");
            testCases[1].CodeFilePath.Should().Be(@"c:\prod\gtest-1.7.0\externalgoogletestlibrary\externalgoogletestlibrarytests.cpp");
            testCases[1].LineNumber.Should().Be(44);
        }
Beispiel #16
0
        private void FindStaticallyLinkedTests(string location)
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(location);

            testCases.Count.Should().Be(2);

            testCases[0].DisplayName.Should().Be("FooTest.MethodBarDoesAbc");
            testCases[0].CodeFilePath.Should().Be(@"c:\prod\gtest-1.7.0\staticallylinkedgoogletests\main.cpp");
            testCases[0].LineNumber.Should().Be(36);

            testCases[1].DisplayName.Should().Be("FooTest.DoesXyz");
            testCases[1].CodeFilePath.Should().Be(@"c:\prod\gtest-1.7.0\staticallylinkedgoogletests\main.cpp");
            testCases[1].LineNumber.Should().Be(45);
        }
Beispiel #17
0
        private void CheckEffectOfDiscoveryParam()
        {
            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            var tests = discoverer.GetTestsFromExecutable(SampleTestToUse);

            tests.Should().NotBeEmpty();

            MockOptions.Setup(o => o.AdditionalTestExecutionParam).Returns("-justfail");

            discoverer = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            tests      = discoverer.GetTestsFromExecutable(SampleTestToUse);

            tests.Should().BeEmpty();
            MockLogger.Verify(l => l.LogError(It.Is <string>(s => s.Contains("failed intentionally"))), Times.AtLeastOnce);
        }
        private void AssertFindsTestWithTraits(string displayName, Trait[] traits)
        {
            Assert.IsTrue(File.Exists(SampleTests), "Build SampleTests in Debug mode before executing this test");

            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            List <TestCase>      tests      = discoverer.GetTestsFromExecutable(SampleTests).ToList();

            TestCase testCase = tests.Find(tc => tc.Traits.Count() == traits.Length && tc.DisplayName.StartsWith(displayName));

            Assert.IsNotNull(testCase);

            foreach (Trait trait in traits)
            {
                Trait foundTrait = testCase.Traits.FirstOrDefault(T => trait.Name == T.Name && trait.Value == T.Value);
                Assert.IsNotNull(foundTrait, "Didn't find trait: (" + trait.Name + ", " + trait.Value + ")");
            }
        }
        private void FindExternallyLinkedTests(string location)
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(location);

            testCases.Count.Should().Be(2);

            string expectedCodeFilePath = Path.GetFullPath($@"{TestResources.SampleTestsSolutionDir}dlldependentproject\dlltests.cpp").ToLower();

            testCases[0].DisplayName.Should().Be("Passing.InvokeFunction");
            testCases[0].CodeFilePath.Should().Be(expectedCodeFilePath);
            testCases[0].LineNumber.Should().Be(5);

            testCases[1].DisplayName.Should().Be("Failing.InvokeFunction");
            testCases[1].CodeFilePath.Should().Be(expectedCodeFilePath);
            testCases[1].LineNumber.Should().Be(10);
        }
        public void GetTestsFromExecutable_OldExecutionEnvironment_LoadTests_AreFoundInReasonableTime()
        {
            MockOptions.Setup(o => o.UseNewTestExecutionFramework).Returns(false);

            var stopwatch              = Stopwatch.StartNew();
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.LoadTests_Generated);

            stopwatch.Stop();
            var actualDuration = stopwatch.Elapsed;

            testCases.Count.Should().BeGreaterThan(0);
            int testParsingDurationInMs = CiSupport.GetWeightedDuration(testCases.Count); // .5ms per test (discovery and processing)
            int overheadInMs            = CiSupport.GetWeightedDuration(1000);            // pretty much arbitrary - let's see...
            var maxDuration             = TimeSpan.FromMilliseconds(testParsingDurationInMs + overheadInMs);

            actualDuration.Should().BeLessThan(maxDuration);
        }
        private void FindTests(string location, int expectedNrOfTestCases = TestResources.NrOfTests)
        {
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(location);

            testCases.Count.Should().Be(expectedNrOfTestCases);

            TestCase testCase = testCases.Single(tc => tc.FullyQualifiedName == "TheFixture.AddFails");

            testCase.DisplayName.Should().Be("TheFixture.AddFails");
            testCase.CodeFilePath.Should().EndWith(@"sampletests\tests\fixturetests.cpp");
            testCase.LineNumber.Should().Be(11);

            testCase = testCases.Single(tc => tc.FullyQualifiedName == "Arr/TypeParameterizedTests/1.CanDefeatMath");
            testCase.DisplayName.Should().Be("Arr/TypeParameterizedTests/1.CanDefeatMath<MyStrangeArray>");
            testCase.CodeFilePath.Should().EndWith(@"sampletests\tests\typeparameterizedtests.cpp");
            testCase.LineNumber.Should().Be(56);
        }
        private void AssertFindsTestWithTraits(string displayName, Trait[] traits)
        {
            SampleTestToUse.AsFileInfo()
            .Should().Exist("building the SampleTests solution produces that executable");

            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            List <TestCase>      tests      = discoverer.GetTestsFromExecutable(SampleTestToUse).ToList();

            TestCase testCase = tests.Find(tc => tc.Traits.Count == traits.Length && tc.DisplayName.StartsWith(displayName));

            testCase.Should().NotBeNull($"Test not found: {displayName}, {traits.Length}");

            foreach (Trait trait in traits)
            {
                Trait foundTrait = testCase.Traits.FirstOrDefault(T => trait.Name == T.Name && trait.Value == T.Value);
                foundTrait.Should().NotBeNull("Didn't find trait: (" + trait.Name + ", " + trait.Value + ")");
            }
        }
Beispiel #23
0
        private void AssertFindsTestWithTraits(string displayName, Trait[] traits)
        {
            File.Exists(SampleTestToUse)
            .Should()
            .BeTrue("Build SampleTests in Debug and Release mode before executing this test");

            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            List <TestCase>      tests      = discoverer.GetTestsFromExecutable(SampleTestToUse).ToList();

            TestCase testCase = tests.Find(tc => tc.Traits.Count == traits.Length && tc.DisplayName.StartsWith(displayName));

            testCase.Should().NotBeNull($"Test not found: {displayName}, {traits.Length}");

            foreach (Trait trait in traits)
            {
                Trait foundTrait = testCase.Traits.FirstOrDefault(T => trait.Name == T.Name && trait.Value == T.Value);
                foundTrait.Should().NotBeNull("Didn't find trait: (" + trait.Name + ", " + trait.Value + ")");
            }
        }
        public void GetTestsFromExecutable_WithoutPathExtension_ProducesWarning()
        {
            string baseDir = TestDataCreator.PreparePathExtensionTest();

            try
            {
                string targetExe = TestDataCreator.GetPathExtensionExecutable(baseDir);

                var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
                IList <TestCase> testCases = discoverer.GetTestsFromExecutable(targetExe);

                testCases.Count.Should().Be(0);
                MockLogger.Verify(l => l.LogError(It.Is <string>(s => s.StartsWith("Could not list test cases of executable"))));
            }
            finally
            {
                Utils.DeleteDirectory(baseDir).Should().BeTrue();
            }
        }
        public void GetTestsFromExecutable_WithPathExtension_FindsTestsWithLocation()
        {
            string baseDir = TestDataCreator.PreparePathExtensionTest();

            try
            {
                string targetExe = Path.Combine(baseDir, "exe", Path.GetFileName(TestResources.DllTests_ReleaseX86));
                MockOptions.Setup(o => o.PathExtension).Returns(SettingsWrapper.ExecutableDirPlaceholder + @"\..\dll");

                var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
                IList <TestCase> testCases = discoverer.GetTestsFromExecutable(targetExe);

                testCases.Count.Should().Be(TestResources.NrOfDllTests);
            }
            finally
            {
                Utils.DeleteDirectory(baseDir).Should().BeTrue();
            }
        }
        public void GetTestsFromExecutable_LoadTests_AreFoundInReasonableTime()
        {
            if (CiSupport.IsRunningOnBuildServer)
            {
                Assert.Inconclusive("Skipping test since it is unstable on the build server");
            }

            var stopwatch              = Stopwatch.StartNew();
            var discoverer             = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options);
            IList <TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.LoadTests_Generated);

            stopwatch.Stop();
            var actualDuration = stopwatch.Elapsed;

            testCases.Count.Should().BePositive();
            int testParsingDurationInMs = CiSupport.GetWeightedDuration(testCases.Count); // .5ms per test (discovery and processing)
            int overheadInMs            = CiSupport.GetWeightedDuration(1000);            // pretty much arbitrary - let's see...
            var maxDuration             = TimeSpan.FromMilliseconds(testParsingDurationInMs + overheadInMs);

            actualDuration.Should().BeLessThan(maxDuration);
        }
        public void GetTestsFromExecutable_WithPathExtension_FindsTestsWithLocation()
        {
            MockOptions.Setup(o => o.PathExtension).Returns(SettingsWrapper.ExecutableDirPlaceholder + @"\..\lib");

            var discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList<TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.PathExtensionTestsExe);
            testCases.Count.Should().Be(TestResources.NrOfPathExtensionTests);
        }
        // ReSharper disable once UnusedParameter.Local
        private void AssertFindsParameterizedTest(string fullyQualifiedName, Regex displayNameRegex)
        {
            File.Exists(TestResources.SampleTests)
                .Should()
                .BeTrue("Build SampleTests in Debug mode before executing this test");

            var discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList<TestCase> tests = discoverer.GetTestsFromExecutable(TestResources.SampleTests);

            TestCase testCase = tests.Single(t => t.FullyQualifiedName == fullyQualifiedName);
            displayNameRegex.IsMatch(testCase.DisplayName).Should().BeTrue();
        }
        private void FindExternallyLinkedTests(string location)
        {
            var discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList<TestCase> testCases = discoverer.GetTestsFromExecutable(location);

            testCases.Count.Should().Be(2);

            testCases[0].DisplayName.Should().Be("BarTest.MethodBarDoesAbc");
            testCases[0].CodeFilePath.Should().Be(@"c:\prod\gtest-1.7.0\externalgoogletestlibrary\externalgoogletestlibrarytests.cpp");
            testCases[0].LineNumber.Should().Be(36);

            testCases[1].DisplayName.Should().Be("BarTest.DoesXyz");
            testCases[1].CodeFilePath.Should().Be(@"c:\prod\gtest-1.7.0\externalgoogletestlibrary\externalgoogletestlibrarytests.cpp");
            testCases[1].LineNumber.Should().Be(44);
        }
        private void FindSampleTests(string location)
        {
            var discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList<TestCase> testCases = discoverer.GetTestsFromExecutable(location);

            testCases.Count.Should().Be(TestResources.NrOfSampleTests);

            TestCase testCase =
               testCases.Single(tc => tc.FullyQualifiedName == "Arr/TypeParameterizedTests/1.CanDefeatMath");

            testCase.DisplayName.Should().Be("Arr/TypeParameterizedTests/1.CanDefeatMath<MyStrangeArray>");
            testCase.CodeFilePath.Should().EndWith(@"sampletests\tests\typeparameterizedtests.cpp");
            testCase.LineNumber.Should().Be(53);
        }
        public void GetTestsFromExecutable_LoadTests_AreFoundInReasonableTime()
        {
            var stopwatch = Stopwatch.StartNew();
            var discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList<TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.LoadTests);
            stopwatch.Stop();
            var actualDuration = stopwatch.Elapsed;

            int testParsingDurationInMs = CiSupport.GetWeightedDuration(0.5 * testCases.Count); // .5ms per test (discovery and processing)
            int overheadInMs = CiSupport.GetWeightedDuration(1000); // pretty much arbitrary - let's see...
            var maxDuration = TimeSpan.FromMilliseconds(testParsingDurationInMs + overheadInMs);

            actualDuration.Should().BeLessThan(maxDuration);
        }
        private void AssertFindsTestWithTraits(string displayName, Trait[] traits)
        {
            File.Exists(SampleTestToUse)
                .Should()
                .BeTrue("Build SampleTests in Debug and Release mode before executing this test");

            GoogleTestDiscoverer discoverer = new GoogleTestDiscoverer(TestEnvironment);
            List<TestCase> tests = discoverer.GetTestsFromExecutable(SampleTestToUse).ToList();

            TestCase testCase = tests.Find(tc => tc.Traits.Count == traits.Length && tc.DisplayName.StartsWith(displayName));
            testCase.Should().NotBeNull($"Test not found: {displayName}, {traits.Length}");

            foreach (Trait trait in traits)
            {
                Trait foundTrait = testCase.Traits.FirstOrDefault(T => trait.Name == T.Name && trait.Value == T.Value);
                foundTrait.Should().NotBeNull("Didn't find trait: (" + trait.Name + ", " + trait.Value + ")");
            }
        }
        public void GetTestsFromExecutable_WithoutPathExtension_ProducesWarning()
        {
            var discoverer = new GoogleTestDiscoverer(TestEnvironment);
            IList<TestCase> testCases = discoverer.GetTestsFromExecutable(TestResources.PathExtensionTestsExe);

            testCases.Count.Should().Be(0);
            MockLogger.Verify(l => l.LogWarning(It.Is<string>(s => s.StartsWith("Could not list test cases of executable"))));
        }