public static void NotNullOrEmpty1() { Action act = () => { Require.NotNullOrEmpty("value", "paramName"); Require.NotNullOrEmpty(" ", "paramName"); }; Assert.DoesNotThrow(act); }
public static void NotNullOrEmpty3() { var paramName = "paramName"; Action act = () => Require.NotNullOrEmpty(String.Empty, paramName); var ex = Record.Exception(act); Assert.NotNull(ex); Assert.NotNull(ex.Message); var argex = Assert.IsType <ArgumentException>(ex); Assert.Equal(paramName, argex.ParamName); }
public static void NotNullOrEmpty_ThrowsArgumentNullException_ForNull() { // Arrange var paramName = "paramName"; Action act = () => Require.NotNullOrEmpty(null, paramName); // Act var ex = Record.Exception(act); // Assert Assert.NotNull(ex); Assert.NotNull(ex.Message); var argex = Assert.IsType <ArgumentNullException>(ex); Assert.Equal(paramName, argex.ParamName); }
public static void NotNullOrEmpty_DoesNotThrow_ForNonNullOrEmptyString() => Require.NotNullOrEmpty("value", "paramName");