public void StringAssert_IsNotEmpty_WithEmptyString_ExceptionIsThrown() { try { StringAssert.IsNotEmpty(string.Empty); Assert.Fail("AssertFailedException was expected"); } catch (AssertFailedException) { } }
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); } }
public void StringAssert_IsNotEmpty_WithNonNullNonEmptyString_NoExceptionIsThrown() { StringAssert.IsNotEmpty("some value"); }
public void StringAssert_IsNotEmpty_WithNullString_NoExceptionIsThrown() { StringAssert.IsNotEmpty(null); }
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); }