コード例 #1
0
        public void ShouldSendEmailToCorrectEmailAndWithCorrectMessageAndWithCorrectTitle_WhenPasswordIsReset_AAAsyntax()
        {
            //Arrange
            const string email        = "*****@*****.**";
            const string newPassword  = "******";
            const string passwordHash = "hash";
            var          user         = new User()
            {
                Email = email
            };

            _passwordGenerator.Stub(x => x.GenerateRandomPassword()).Return(newPassword);
            _passwordCryptography.Stub(x => x.GenerateHash(newPassword)).Return(passwordHash);
            //Act
            _userManager.ResetPassword(user);
            //Assert
            _mailSender.AssertWasCalled(x => x.SendEmail(
                                            email,
                                            "Your new password is: newPass",
                                            "New Password"));
        }