Matches() public method

public Matches ( TestCase testCase ) : bool
testCase TestCase
return bool
Ejemplo n.º 1
0
        public void Matches_ExpressionMatchesDisplayName_CorrectFiltering()
        {
            List <TestCase> testCases = TestDataCreator.CreateDummyTestCases("Foo.Bar").Select(tc => tc.ToVsTestCase()).ToList();

            _mockFilterExpression.Setup(e => e.MatchTestCase(It.Is <TestCase>(tc => tc == testCases[0]), It.Is <Func <string, object> >(f => f("DisplayName").ToString() == "Foo.Bar"))).Returns(true);

            TestCaseFilter filter  = new TestCaseFilter(MockRunContext.Object, _traitNames, TestEnvironment.Logger);
            bool           matches = filter.Matches(testCases[0]);

            matches.Should().BeTrue();
        }
Ejemplo n.º 2
0
        public void Matches_ExpressionMatchesDisplayName_CorrectFiltering()
        {
            List <TestCase> testCases = CreateDummyTestCases("Foo.Bar").Select(DataConversionExtensions.ToVsTestCase).ToList();

            MockFilterExpression.Setup(e => e.MatchTestCase(It.Is <TestCase>(tc => tc == testCases[0]), It.Is <Func <string, object> >(f => f("DisplayName").ToString() == "Foo.Bar"))).Returns(true);

            TestCaseFilter filter  = new TestCaseFilter(MockRunContext.Object, traitNames, TestEnvironment);
            bool           matches = filter.Matches(testCases[0]);

            Assert.IsTrue(matches);
        }
        public void Matches_ExpressionMatchesDisplayName_CorrectFiltering()
        {
            List<TestCase> testCases = TestDataCreator.CreateDummyTestCases("Foo.Bar").Select(DataConversionExtensions.ToVsTestCase).ToList();
            _mockFilterExpression.Setup(e => e.MatchTestCase(It.Is<TestCase>(tc => tc == testCases[0]), It.Is<Func<string, object>>(f => f("DisplayName").ToString() == "Foo.Bar"))).Returns(true);

            TestCaseFilter filter = new TestCaseFilter(MockRunContext.Object, _traitNames, TestEnvironment);
            bool matches = filter.Matches(testCases[0]);

            matches.Should().BeTrue();
        }