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

            // When
            validator.HaveCountGreaterThanOrEqualTo(1);

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

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

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

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