示例#1
0
        //[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);
        }
        //[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);
        }