title: Linq to Moq - Nullable Types
body: <p>I am writing a unit test and in it trying to setup a simple generic list containg mocks of an entity class...</p>
  
  <pre><code>Dim schedules = New List(Of Schedule) From
       {
           Mock.Of(Of Schedule)(Function(s) s.ActiveFrom = "2010-01-01" AndAlso
                                            s.ActiveUntil = New DateTime?("2110-01-01"))
       }
  </code></pre>
  
  <p><br/>
  <code>Schedule.ActiveFrom</code> is a <code>Date</code> and <code>Schedule.ActiveUntill</code> is a <code>Nullable(Of Date)</code>.
  <br /></p>
  
  <p>When i run the unit test i get the following error message... </p>
  
  <blockquote>
    <p>The binary operator AndAlso is not defined for the types 'System.Nullable[System.Boolean] >and System.Boolean</p>
  </blockquote>
  
  <p><br />
  I'm stumped; Where am I going wrong?</p>