public void ValidateStringNotToBeNullValue() { // Given var validator = new StringInverseValidator("string"); // When validator.Be(null); // Then Assert.True(true); }
public void ValidateStringNotToBeCaseSensitiveValue() { // Given var validator = new StringInverseValidator("string"); // When validator.Be("STRING"); // Then Assert.True(true); }
public void ValidateStringNotStartsWithNull() { // Given var validator = new StringInverseValidator("string"); // When validator.StartWith(null); // Then Assert.True(true); }
public void ValidateStringNotMatchesValue() { // Given var validator = new StringInverseValidator("string"); // When validator.Match("other"); // Then Assert.True(true); }
public void ValidateNullStringNotStartsWithValue() { // Given var validator = new StringInverseValidator(null); // When validator.StartWith("other"); // Then Assert.True(true); }
public void ValidateStringNotMatchesRegex() { // Given var validator = new StringInverseValidator("string"); // When validator.MatchRegex("^.$"); // Then Assert.True(true); }
public void ValidateStringNotEndsWithValue() { // Given var validator = new StringInverseValidator("string"); // When validator.EndWith("other"); // Then Assert.True(true); }
public void ValidateNullStringNotToBeValueViolated() { // Given var validator = new StringInverseValidator(null); // When var exception = Assert.Throws <XunitException>(() => validator.Be(null)); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"\"{rn}but was expected not to be \"\"", 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); }
public void ValidateStringNotMatchesRegexPatternViolated() { // Given var validator = new StringInverseValidator("string"); // When var exception = Assert.Throws <XunitException>(() => validator.MatchRegex(".*", "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 not match regular expression \".*\"{rn}because that's the bottom line", exception.UserMessage); }
public void ValidateStringNotMatchesWildcardIgnoreCaseValueViolated() { // Given var validator = new StringInverseValidator("string"); // When var exception = Assert.Throws <XunitException>(() => validator.Match("sT*Ng", ignoreCase: true, because: "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 not match pattern \"sT*Ng\"{rn}because that's the bottom line", exception.UserMessage); }
public void ValidateNullStringNotToBeNullOrEmptyViolated() { // Given var validator = new StringInverseValidator(null); // When var exception = Assert.Throws <XunitException>(() => validator.BeNullOrEmpty(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 null or empty{rn}because that's the bottom line", exception.UserMessage); }
public void ValidateStringNotToBeCaseInsensitiveValue() { // Given var validator = new StringInverseValidator("string"); // When var exception = Assert.Throws <XunitException>(() => validator.Be("STRING", ignoreCase: true)); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"string\"{rn}but was expected not to be \"STRING\"", exception.UserMessage); }