public void ValidateNullStringNotStartsWithValue() { // Given var validator = new StringInverseValidator(null); // When validator.StartWith("other"); // Then Assert.True(true); }
public void ValidateStringNotStartsWithNull() { // Given var validator = new StringInverseValidator("string"); // When validator.StartWith(null); // Then Assert.True(true); }
public void ValidateNullStringNotStartsWithNullViolated() { // Given var validator = new StringInverseValidator(null); // When var exception = Assert.Throws <XunitException>(() => validator.StartWith(null)); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"\"{rn}but was expected not to start with \"\"", exception.UserMessage); }
public void ValidateStringNotStartsWithValueViolated() { // Given var validator = new StringInverseValidator("string"); // When var exception = Assert.Throws <XunitException>(() => validator.StartWith("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 start with \"string\"{rn}because that's the bottom line", exception.UserMessage); }