Exemplo n.º 1
0
        public void Given_request_does_not_equal_expression_when_matching_should_not_match()
        {
            _sut = new ExpressionMatcher(_ => false);

            // Act & assert
            _sut.IsMatch(new MockHttpRequestContext(new HttpRequestMessage())).Should().BeFalse();
        }
Exemplo n.º 2
0
        public void Given_null_context_when_matching_it_should_throw()
        {
            _sut = new ExpressionMatcher(_ => true);
            MockHttpRequestContext requestContext = null;

            // Act
            // ReSharper disable once ExpressionIsAlwaysNull
            Action act = () => _sut.IsMatch(requestContext);

            // Assert
            act.Should()
            .Throw <ArgumentNullException>()
            .WithParamName(nameof(requestContext));
        }