Exemple #1
0
        public async Task ShouldDisableUser(
            TestableContext context,
            Handler handler
            )
        {
            context.UoW.Plan <User>(context.Id())
            .HasEvent <Events.Registered>(x =>
            {
                x.UserName  = context.Id();
                x.GivenName = "test";
                x.Password  = "******";
            });

            var command = new Commands.Disable
            {
                UserName = context.Id()
            };
            await handler.Handle(command, context).ConfigureAwait(false);

            context.UoW.Check <User>(context.Id()).Raised <Events.Disabled>();
        }
Exemple #2
0
        public async Task Handle(Commands.Disable command, IMessageHandlerContext ctx)
        {
            var user = await ctx.For <User>().Get(command.UserName).ConfigureAwait(false);

            user.Disable();
        }