public void ThrowIfNullThrowsExceptionWithParameterName() { TestArgumentItem arg = null; string parameterName = null; try { arg.ThrowIfNull("param1"); } catch (ArgumentNullException e) { parameterName = e.ParamName; } Assert.AreEqual("param1", parameterName); }
public void ThrowIfNullThrowsIfParameterIsNull() { TestArgumentItem arg = null; Assert.Throws <ArgumentNullException>(() => arg.ThrowIfNull("param1")); }