Exemple #1
0
        public void Given_version_does_not_matches_expected_version_when_matching_should_not_match()
        {
            var request = new HttpRequestMessage
            {
                Version = new Version(2, 0)
            };

            _sut = new VersionMatcher(new Version(2, 1));

            // Act & assert
            _sut.IsMatch(new MockHttpRequestContext(request)).Should().BeFalse();
        }
Exemple #2
0
        public void Given_null_context_when_matching_it_should_throw()
        {
            _sut = new VersionMatcher(new Version(1, 0));
            MockHttpRequestContext requestContext = null;

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

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