public void ValidateNullStringNotEndsWithValue() { // Given var validator = new StringInverseValidator(null); // When validator.EndWith("other"); // Then Assert.True(true); }
public void ValidateStringNotEndsWithNull() { // Given var validator = new StringInverseValidator("string"); // When validator.EndWith(null); // Then Assert.True(true); }
public void ValidateNullStringNotEndsWithNullViolated() { // Given var validator = new StringInverseValidator(null); // When var exception = Assert.Throws <XunitException>(() => validator.EndWith(null)); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"\"{rn}but was expected not to end with \"\"", exception.UserMessage); }
public void ValidateStringNotEndsWithValueViolated() { // Given var validator = new StringInverseValidator("string"); // When var exception = Assert.Throws <XunitException>(() => validator.EndWith("string", "that's the bottom line")); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"string\"{rn}but was expected not to end with \"string\"{rn}because that's the bottom line", exception.UserMessage); }