title: Asp.net FluentValidation unit testing object as null
body: <p>I'm doing some unit testing using FluentValidation in Asp.net. I have setup a rule stating that an object is not allowed to be null, as it's going to be used as an argument in a method. The rule is made in a validator-class in the constructor: </p>
  
  <pre><code> //Object itself.
   RuleFor(x =&gt; x).NotNull();
  </code></pre>
  
  <p>The unit test looks like (I'm using NUnit):</p>
  
  <pre><code>[Test]
  public void RequestObjectIsNull_ExpectError()
  {
      BusinessRequest request = null;
      var result = validator.Validate(request);
  
      Assert.IsFalse(result.IsValid);
  }
  </code></pre>
  
  <p>It fails with the message:</p>
  
  <blockquote>
    <p>Message: System.ArgumentNullException : Cannot pass null model to Validate.
    Parameter name: instanceToValidate</p>
  </blockquote>
  
  <p>How do I test this?</p>