public void Can_change_actors_password() { var createActor = new CreateActor { ActorId = Guid.NewGuid(), Password = TestDataGenerator.GetRandomString(), Username = TestDataGenerator.GetRandomString() }; _authCommands.CreateActor(createActor); var actor = _authRepository.Actors.Single(a => a.Id == createActor.ActorId); var encryptedPassword = actor.EncryptedPassword; var changePassword = new ChangePassword { ActorId = createActor.ActorId, NewPassword = TestDataGenerator.GetRandomString() }; _authCommands.ChangePassword(changePassword); actor = _authRepository.Actors.Single(a => a.Id == createActor.ActorId); actor.EncryptedPassword.Should().NotBe(encryptedPassword); }
public void ChangePassword(AdminId adminId, string password) { _authCommands.ChangePassword(new ChangePassword { ActorId = adminId, NewPassword = password }); _eventBus.Publish(new AdminPasswordChanged(adminId)); }