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