示例#1
0
 public void StringAssert_IsEmpty_WithNonNullNonEmptyString_ExceptionIsThrown()
 {
     try {
         StringAssert.IsEmpty("some value");
         Assert.Fail("AssertFailedException was expected");
     }
     catch (AssertFailedException) {
     }
 }
示例#2
0
 public void StringAssert_IsEmpty_WithNullString_ExceptionIsThrown()
 {
     try {
         StringAssert.IsEmpty(null);
         Assert.Fail("AssertFailedException was expected");
     }
     catch (AssertFailedException) {
     }
 }
示例#3
0
 public void StringAssert_IsEmptyWithMessage_WithNonNullNonEmptyString_ExceptionIsThrown()
 {
     try {
         StringAssert.IsEmpty("some value", "AssertMessage");
         Assert.Fail("AssertFailedException was expected");
     }
     catch (AssertFailedException ex) {
         Assert.AreEqual("AssertMessage", ex.Message);
     }
 }
示例#4
0
 public void IsEmpty()
 {
     StringAssert.IsEmpty("");
 }
示例#5
0
 public void StringAssert_IsEmpty_WithEmptyString_NoExceptionIsThrown()
 {
     StringAssert.IsEmpty(string.Empty);
 }
示例#6
0
 public void StringAssert_IsEmptyWithMessage_WithEmptyString_NoExceptionIsThrown()
 {
     StringAssert.IsEmpty(string.Empty, "AssertMessage");
 }
示例#7
0
 public void IsEmptyNullFail()
 {
     StringAssert.IsEmpty(null);
 }
 /// <summary>
 /// Asserts that a string is 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 IsEmpty(this StringAssert assert, string?value, string message)
 {
     assert.IsEmpty(value, message, value?.Length !);
 }
 /// <summary>
 /// Asserts that a string is 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 IsEmpty(this StringAssert assert, string?value)
 {
     assert.IsEmpty(value, Strings.IsEmptyStringFailMsg);
 }