Пример #1
0
        public void MatchReturnTrueForClassSatisfyingExpression1()
        {
            // Given
            var argument = "";
            var sut      = new MatchArgChecker <string>(x => x != null);

            // When
            var result = sut.Match(argument);

            // Then
            Assert.True(result);
        }
Пример #2
0
        public void MatchReturnTrueForSatisfyingExpression()
        {
            // Given
            var argument = 10;
            var sut      = new MatchArgChecker <int>(x => x > 5);

            // When
            var result = sut.Match(argument);

            // Then
            Assert.True(result);
        }
Пример #3
0
        public void MatchReturnFalseForNullableInvalidTypes()
        {
            // Given
            int?argument = 11;
            var sut      = new MatchArgChecker <long?>(x => x.HasValue && x.Value == 11);

            // When
            var result = sut.Match(argument);

            // Then
            Assert.False(result);
        }
Пример #4
0
        public void MatchReturnFalseForClassInvalidTypes()
        {
            // Given
            var argument = "";
            var sut      = new MatchArgChecker <object>(x => x != null);

            // When
            var result = sut.Match(argument);

            // Then
            Assert.False(result);
        }
Пример #5
0
        public void MatchReturnTrueForNullableSatisfyingExpression2()
        {
            // Given
            int?argument = 11;
            var sut      = new MatchArgChecker <int?>(x => x.HasValue && x.Value == 11);

            // When
            var result = sut.Match(argument);

            // Then
            Assert.True(result);
        }