public void ResetUserPassword() { var userId = Guid.NewGuid(); var resetDate = DateTime.Now; var command = new ResetUserPassword(userId, "123abc", resetDate); Assert.AreEqual(userId, command.AggregateId); Assert.AreEqual("123abc", command.NewPassword); Assert.AreEqual(resetDate, command.LastPasswordChangedDate); }
public void HandleResetUserPassword() { var handler = GetHandler(); var dateRef = DateTime.Now; var command = new ResetUserPassword(guid, "newpwd", dateRef); handler.Handle(command); Assert.AreEqual(guid, user.Id); Assert.AreEqual("newpwd", user.Password); Assert.AreEqual(dateRef, user.LastPasswordChangedDate); repository.Verify(x => x.Save(user, It.IsAny<Guid>(), It.IsAny<Action<IDictionary<string, object>>>()), Times.Once()); }