title: Unit Test - Invalid Operation Exception
body: <p>My <strong><em>Unit Test</em></strong> is returning an error stating: <code>System.InvalidOperationException: Sequence contains no matching element.</code></p>
  
  <p>When I start debugging, it automatically stops my debugger after hitting <code>var result = _forgotPass.SendEmail(...);</code> Why is it throwing this exception
  and how can I fix this issue?</p>
  
  <p><strong>Error:</strong> <code>System.InvalidOperationException: Sequence contains no matching element.</code></p>
  
  <p><strong>Unit Test:</strong></p>
  
  <pre><code>[TestMethod]
  public void SendEmail()
  {
      //Arrange
      _getUrl.Setup(mock =&gt; mock.AddUrlLink(It.IsAny&lt;string&gt;())).Returns(new ApiResponse&lt;Status, string&gt;(Status.Success, "link"));
      _emailMock.Setup(mock =&gt; mock.Send(It.IsAny&lt;CarrierModel&gt;())).Returns(new ApiResponse&lt;bool, string&gt;(false, ""));
  
      //Act
      var result = _forgotPass.SendEmail("myemail@gmail.com");
  
      //Assert
      Assert.AreEqual(Status.EmailFailed, result.Status);
      Assert.IsNull(result.Body);
      Assert.IsTrue(result.Messages.Any(m =&gt; m == "Email Failed"));
  }
  </code></pre>