title: MOQ: Cant cast Moq.Mock to Interface in VB.Net
body: <p>I am writing a simple unit test to check if the proper view name is being returned by an ActionResult in VB.Net MVC 1.  The controller requires a service and I am trying to Mock the service but keep getting this error.</p>
  
  <pre><code>Unable to cast object of type 'Moq.Mock`1[SRE.Web.Mvc.INotificationService]' to type 'SRE.Web.Mvc.INotificationService'.
  </code></pre>
  
  <p>As I said, the simple and I'm not sure where to go from here.</p>
  
  <p>Here is the test.</p>
  
  <pre><code>&lt;Test()&gt; _
      Public Sub Index_Properly_Validates_Email_Address()
          'Arrange
          Dim fakeNotifcationService As New Mock(Of INotificationService)(MockBehavior.Strict)
          Dim controller As New CustomerServiceController(fakeNotifcationService)
          Dim result As ViewResult
  
  
          'Act
          result = controller.Feedback("fake@fake.com", "fakesubject", "fakemessage")
          'Assert
          Assert.AreEqual("thankyou", result.ViewName)
  
      End Sub
  </code></pre>