Esempio n. 1
0
        public void ValidateStringNotToBeEmpty()
        {
            // Given
            var validator = new StringInverseValidator("string");

            // When
            validator.BeEmpty();

            // Then
            Assert.True(true);
        }
Esempio n. 2
0
        public void ValidateStringNotToBeEmptyViolated()
        {
            // Given
            var validator = new StringInverseValidator(string.Empty);

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

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

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