public async Task RevokeClient_should_create_events_and_update_state() { var command = new RevokeClient { Id = clientId }; await ExecuteCreateAsync(); await ExecuteAttachClientAsync(); var result = await sut.ExecuteAsync(CreateCommand(command)); result.ShouldBeEquivalent(sut.Snapshot); Assert.False(sut.Snapshot.Clients.ContainsKey(clientId)); LastEvents .ShouldHaveSameEvents( CreateEvent(new AppClientRevoked { Id = clientId }) ); }
private void RevokeClient(RevokeClient command) { Raise(command, new AppClientRevoked()); }
public void RevokeClient(RevokeClient command) { RaiseEvent(SimpleMapper.Map(command, new AppClientRevoked())); }
public void CanRevoke_should_throw_execption_if_client_id_is_null() { var command = new RevokeClient(); Assert.Throws <ValidationException>(() => GuardAppClients.CanRevoke(clients, command)); }
protected Task On(RevokeClient command, CommandContext context) { return(handler.UpdateAsync <AppDomainObject>(context, a => a.RevokeClient(command))); }