Ejemplo n.º 1
0
        public void ValidateEnumerableNotToBeNull()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(new List <int>());

            // When
            validator.BeNull();

            // Then
            Assert.True(true);
        }
Ejemplo n.º 2
0
        public void ValidateEnumerableNotHaveCountGreaterThanOrEqualTo()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(new List <int>());

            // When
            validator.HaveCountGreaterThanOrEqualTo(1);

            // Then
            Assert.True(true);
        }
Ejemplo n.º 3
0
        public void ValidateEnumerableNotHaveCountOf()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(new List <int> {
                1
            });

            // When
            validator.HaveCountOf(2);

            // Then
            Assert.True(true);
        }
Ejemplo n.º 4
0
        public void ValidateEnumerableNotToBeNullViolated()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(null);

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

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

            Assert.Equal(
                $"{rn}validator{rn}is null{rn}but was expected not to be null{rn}because that's the bottom line",
                exception.UserMessage);
        }
Ejemplo n.º 5
0
        public void ValidateEnumerableToBeEmtpyViolated()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(new List <int>());

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

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

            Assert.Equal(
                $"{rn}validator{rn}contains \"0\" item(s){rn}but was expected not to be empty{rn}because that's the bottom line",
                exception.UserMessage);
        }
Ejemplo n.º 6
0
        public void ValidateEnumerableNotHaveCountOfViolated()
        {
            // Given
            var validator = new EnumerableInverseValidator <int>(new List <int> {
                1
            });

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

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

            Assert.Equal(
                $"{rn}validator{rn}contains \"1\" item(s){rn}but was expected not to have \"1\" item(s){rn}because that's the bottom line",
                exception.UserMessage);
        }