public void ValidateStringEndWithValue() { // Given var validator = new StringValidator("string"); // When validator.EndWith("ing"); // Then Assert.True(true); }
public void ValidateNullStringEndWithNullViolated() { // Given var validator = new StringValidator(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 to end with \"\"", exception.UserMessage); }
public void ValidateStringEndWithValueViolated() { // Given var validator = new StringValidator("string"); // When var exception = Assert.Throws <XunitException>(() => validator.EndWith("other", "that's the bottom line")); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"string\"{rn}but was expected to end with \"other\"{rn}because that's the bottom line", exception.UserMessage); }