public void ReturnParameter_OrThrowIfEmptyOrWhitespace_Whitespace() { var x = Assert.Throws <ArgumentException>(() => ReturnParameter.OrThrowIfEmptyOrWhitespace(" ", "testString")); Assert.That(x.Message, Does.StartWith("Value should not be whitespace")); }
public void ReturnParameter_OrThrowIfEmptyOrWhitespace_Ok() { Assert.DoesNotThrow(() => ReturnParameter.OrThrowIfEmptyOrWhitespace("helloWorld", "testString")); Assert.AreEqual(ReturnParameter.OrThrowIfEmptyOrWhitespace("helloWorld", "testString"), "helloWorld"); }
public void ReturnParameter_OrThrowIfEmptyOrWhitespace_Null() { var result = ReturnParameter.OrThrowIfEmptyOrWhitespace(null, "testString"); Assert.AreEqual(null, result); }