Ejemplo n.º 1
0
        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
            })
                );
        }
Ejemplo n.º 2
0
 private void RevokeClient(RevokeClient command)
 {
     Raise(command, new AppClientRevoked());
 }
Ejemplo n.º 3
0
 public void RevokeClient(RevokeClient command)
 {
     RaiseEvent(SimpleMapper.Map(command, new AppClientRevoked()));
 }
Ejemplo n.º 4
0
        public void CanRevoke_should_throw_execption_if_client_id_is_null()
        {
            var command = new RevokeClient();

            Assert.Throws <ValidationException>(() => GuardAppClients.CanRevoke(clients, command));
        }
Ejemplo n.º 5
0
 protected Task On(RevokeClient command, CommandContext context)
 {
     return(handler.UpdateAsync <AppDomainObject>(context, a => a.RevokeClient(command)));
 }