예제 #1
0
        public void ValidateEnumerableNotToBeNullOrEmpty()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(new List <int> {
                1
            });

            // When
            validator.BeNullOrEmpty();

            // Then
            Assert.True(true);
        }
예제 #2
0
        public void ValidateEnumerableToBeNullOrEmtpyViolated()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(null);

            // When
            var exception = Assert.Throws <XunitException>(() => validator.BeNullOrEmpty("that's the bottom line"));

            // Then
            Assert.NotNull(exception);
            var rn = Environment.NewLine;

            Assert.Equal(
                $"{rn}validator{rn}is null or empty{rn}but was expected not to be null or empty{rn}because that's the bottom line",
                exception.UserMessage);
        }