Exemplo n.º 1
0
        public void GetFilterExpressionForValidRunContextReturnsValidTestCaseFilterExpression()
        {
            TestableTestExecutionRecorder recorder = new TestableTestExecutionRecorder();
            var dummyFilterExpression     = new TestableTestCaseFilterExpression();
            TestableRunContext runContext = new TestableRunContext(() => dummyFilterExpression);
            var filterExpression          = this.TestMethodFilter.GetFilterExpression(runContext, recorder, out var filterHasError);

            Assert.AreEqual(dummyFilterExpression, filterExpression);
            Assert.IsFalse(filterHasError);
        }
Exemplo n.º 2
0
        public void GetFilterExpressionForRunContextGetTestCaseFilterThrowingExceptionReturnsNullWithFilterHasErrorTrue()
        {
            TestableTestExecutionRecorder recorder   = new TestableTestExecutionRecorder();
            TestableRunContext            runContext = new TestableRunContext(() => { throw new TestPlatformFormatException("DummyException"); });
            var filterExpression = this.TestMethodFilter.GetFilterExpression(runContext, recorder, out var filterHasError);

            Assert.IsNull(filterExpression);
            Assert.IsTrue(filterHasError);
            Assert.AreEqual("DummyException", recorder.Message);
            Assert.AreEqual(TestMessageLevel.Error, recorder.TestMessageLevel);
        }