Beispiel #1
0
 public void StringAssert_IsEmpty_WithNonNullNonEmptyString_ExceptionIsThrown()
 {
     try {
         StringAssert.IsEmpty("some value");
         Assert.Fail("AssertFailedException was expected");
     }
     catch (AssertFailedException) {
     }
 }
Beispiel #2
0
 public void StringAssert_IsEmpty_WithNullString_ExceptionIsThrown()
 {
     try {
         StringAssert.IsEmpty(null);
         Assert.Fail("AssertFailedException was expected");
     }
     catch (AssertFailedException) {
     }
 }
Beispiel #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);
     }
 }
Beispiel #4
0
 public void IsEmpty()
 {
     StringAssert.IsEmpty("");
 }
Beispiel #5
0
 public void StringAssert_IsEmpty_WithEmptyString_NoExceptionIsThrown()
 {
     StringAssert.IsEmpty(string.Empty);
 }
Beispiel #6
0
 public void StringAssert_IsEmptyWithMessage_WithEmptyString_NoExceptionIsThrown()
 {
     StringAssert.IsEmpty(string.Empty, "AssertMessage");
 }
Beispiel #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);
 }