示例#1
0
 public void StringAssert_IsNotEmpty_WithEmptyString_ExceptionIsThrown()
 {
     try {
         StringAssert.IsNotEmpty(string.Empty);
         Assert.Fail("AssertFailedException was expected");
     }
     catch (AssertFailedException) {
     }
 }
示例#2
0
 public void StringAssert_IsNotEmptyWithMessage_WithEmptyString_ExceptionIsThrown()
 {
     try {
         StringAssert.IsNotEmpty(string.Empty, "AssertMessage");
         Assert.Fail("AssertFailedException was expected");
     }
     catch (AssertFailedException ex) {
         Assert.AreEqual("AssertMessage", ex.Message);
     }
 }
示例#3
0
 public void StringAssert_IsNotEmpty_WithNonNullNonEmptyString_NoExceptionIsThrown()
 {
     StringAssert.IsNotEmpty("some value");
 }
示例#4
0
 public void StringAssert_IsNotEmpty_WithNullString_NoExceptionIsThrown()
 {
     StringAssert.IsNotEmpty(null);
 }
示例#5
0
 public void StringAssert_IsNotEmptyWithMessage_WithNullString_NoExceptionIsThrown()
 {
     StringAssert.IsNotEmpty(null, "AssertMessage");
 }
 /// <summary>
 /// Asserts that a string is not empty.
 /// </summary>
 /// <param name="assert">The <see cref="StringAssert"/> instance to extend.</param>
 /// <param name="value">The value to be tested.</param>
 /// <param name="message">
 /// A message to display. This message can be seen in the unit test results.
 /// </param>
 public static void IsNotEmpty(this StringAssert assert, string?value, string message)
 {
     assert.IsNotEmpty(value, message, Array.Empty <object>());
 }
 /// <summary>
 /// Asserts that a string is not empty.
 /// </summary>
 /// <param name="assert">The <see cref="StringAssert"/> instance to extend.</param>
 /// <param name="value">The value to be tested.</param>
 public static void IsNotEmpty(this StringAssert assert, string?value)
 {
     assert.IsNotEmpty(value, Strings.IsNotEmptyStringFailMsg);
 }