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>();
        }
Exemplo n.º 2
0
 public void ShouldThrowExceptionIfArgumentIsNull()
 {
     // Act
     ArgumentExtensions.IsNull <List <int> >(null);
 }