public void testNonEmpty() { try { SanityCheck.NonEmpty(" ", "empty-string"); Assert.Fail("empty value has not been detected"); } catch (ArgumentException ae) { Assert.AreEqual("'empty-string' can't be empty or null", ae.Message); } }
public void testNonEmptyWithCustomMessage() { try { SanityCheck.NonEmpty(" ", "Parameter '{0}' must be valorised and only spaces are not accepted", "testParam"); Assert.Fail("empty value has not been detected"); } catch (ArgumentException ae) { Assert.AreEqual( "Parameter 'testParam' must be valorised and only spaces are not accepted", ae.Message); } }
public void testNonEmptyNoTrim() { SanityCheck.NonEmpty(" ", "empty-string", false); }