コード例 #1
0
ファイル: AppGrainTests.cs プロジェクト: xixaoly/squidex
        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
            })
                );
        }
コード例 #2
0
 private void RevokeClient(RevokeClient command)
 {
     Raise(command, new AppClientRevoked());
 }
コード例 #3
0
 public void RevokeClient(RevokeClient command)
 {
     RaiseEvent(SimpleMapper.Map(command, new AppClientRevoked()));
 }
コード例 #4
0
ファイル: GuardAppClientsTests.cs プロジェクト: ifle/squidex
        public void CanRevoke_should_throw_execption_if_client_id_is_null()
        {
            var command = new RevokeClient();

            Assert.Throws <ValidationException>(() => GuardAppClients.CanRevoke(clients, command));
        }
コード例 #5
0
 protected Task On(RevokeClient command, CommandContext context)
 {
     return(handler.UpdateAsync <AppDomainObject>(context, a => a.RevokeClient(command)));
 }