//[TestMethod] public void TestThatRegistrationSendsConfirmationMail() { Continuum.WebApi.Controllers.AccountController account = new WebApi.Controllers.AccountController(); var mock = new MockMailProvider(); account.MailProvider = mock; Random r = new Random(); RegisterBindingModel model = new RegisterBindingModel() { Email = r.Next() + "@example.com", Password = "******", ConfirmPassword = "******" }; var result = account.Register(model); result.Wait(); Assert.IsTrue(mock.MailWasSent, "Mail was not sent"); Assert.IsTrue(mock.Message.Destination == model.Email); }