private void NotEmptyRuleTest() { string nullString = null; string someString = "Testing «ταБЬℓσ»: 1<2 & 4+1>3, now 20% off!"; string emptyString = ""; var stringNotEmptyRule = new StringNotEmptyRule() { }; Assert.True(stringNotEmptyRule.Check(someString)); Assert.False(stringNotEmptyRule.Check(emptyString)); Assert.False(stringNotEmptyRule.Check(nullString)); }
public void Check_ForNonEmptyString_ReturnsTrue(string value) { var rule = new StringNotEmptyRule(ErrorMessage); var isValid = rule.Check(value); Assert.True(isValid); }
public void Check_ForEmptyOrWhiteSpaceString_ReturnsFalse(string value) { var rule = new StringNotEmptyRule(ErrorMessage); var isValid = rule.Check(value); Assert.False(isValid); }