title: Unit testing/How to assert a non-mocked method was called/C#/Rhino Mocks/NUnit
body: <p>I have a MailService which permit me to send Email which implement the following Interface.</p>
  
  <pre><code>public interface IMailService
    {
      bool SendRegisteringEmail(RegisterModel registerModel);
      bool SendMail(MailMessage mailMessage);
      MailMessage CreateRegisteringMailMessage(RegisterModel registerModel);
  
      IAppSettingsRepository AppSettingsRepository { get; set; }
  
      ISmtpClient SmtpClient { get; set; }
    }
  </code></pre>
  
  <p>The function SendRegisteringEmail should call CreateRegisteringMailMessage then give the return MailMessage to the SendMail function and SendRegisteringEmail should return the return Boolean of SendMail.</p>
  
  <p>I'm using NUnit and Rhino Mocks to do my test, I'm new to testing (1week) and I'm practicing TDD (At least I try). My problem is I don't know how to assert that CreateRegisteringMailMessage was called when I call SendRegisteringEmail, because MailService isn't a Mocked Object.
  Here is my test:</p>
  
  <pre><code>[Test]
  public void SendRegisteringEmail_ShouldCallCreateRegisteringMailMessage()
  {
    //Arrange
    //MailMessage mailMessage = new MailMessage();
    IMailService mailService = new MailService { AppSettingsRepository = CreateAppSettingsMockReposotory() };
    //ISmtpClient smtpClientStub = MockRepository.GenerateStub&lt;ISmtpClient&gt;();
    //mailService.SmtpClient = smtpClientStub;
    //smtpClientStub.Stub(f =&gt; f.Send(mailMessage)).Return(true);
  
  
    //Act
    mailService.SendRegisteringEmail(ValidRegisterModel);
  
    //Assert
    mailService.AssertWasCalled(f =&gt; f.CreateRegisteringMailMessage(ValidRegisterModel));
  }
  </code></pre>
  
  <p>I get the following error when I launch my test:
  FtpWeb.Tests.MailServiceTests.SendRegisteringEmail_ShouldCallCreateRegisteringMailMessage:
  System.InvalidOperationException : The object 'FtpWeb.Models.MailService' is not a mocked object.</p>
  
  <p>I understand why I'm getting this error but now how to test my call.
  Since it's the same object I can't mock it to test it.
  If anybody can give me some lead to resolve this.</p>
  
  <p>Thanks.</p>