Beispiel #1
0
        public void TestGiveTemporaryPasswordNotification()
        {
            _smtpClientMock.Setup(s => s.Send(It.IsAny <MailMessage>())).Callback <MailMessage>(
                m =>
            {
                Assert.AreEqual("*****@*****.**", m.To[0].Address);
                Assert.AreEqual("Project C.U.R.E - Password reset confirmation", m.Subject);
                Assert.IsTrue(m.Body.Contains("Dear Test User"));
                Assert.IsTrue(m.Body.Contains("xyz"));
            });
            var testEmailer = new EmailNotifier(_smtpClientMock.Object);

            testEmailer.GiveTemporaryPasswordNotification(_repositoryMock.Object, "*****@*****.**", "xyz");
        }