public void WhenNullOrEmptyOrWhitespace_ThenThrowException(string value) { var ex = Assert.Throws <ArgumentNullOrWhiteSpaceException>(() => ArgMustBe.NotNullOrWhiteSpace(value)); Assert.That(ex.ParamName, Is.Null); }
public void WhenParamNamePassedIn_ThenSetExceptionParamName() { var ex = Assert.Throws <ArgumentNullOrWhiteSpaceException>(() => ArgMustBe.NotNullOrWhiteSpace(null, "value")); Assert.That(ex.ParamName, Is.EqualTo("value")); }
public void WhenNotNullOrWhiteSpace_ThenNotThrowException() { const string param = "Test"; Assert.DoesNotThrow(() => ArgMustBe.NotNullOrWhiteSpace(param)); }