public void ShouldThrowExceptions() { Action nullObject = () => ArgumentExtensions.EnsureArgumentNotNull <object>(null, "argumentName"); nullObject.Should().Throw <ArgumentNullException>(); Action emptyString = () => ArgumentExtensions.EnsureArgumentNotNullOrWhitespace(string.Empty, "argumentName"); Action whitespaceString = () => ArgumentExtensions.EnsureArgumentNotNullOrWhitespace(" ", "argumentName"); emptyString.Should().Throw <ArgumentNullException>(); whitespaceString.Should().Throw <ArgumentNullException>(); }
public void ShouldThrowExceptionIfArgumentIsNull() { // Act ArgumentExtensions.IsNull <List <int> >(null); }