Exemplo n.º 1
0
        public async Task ShouldCreateRole(
            TestableContext context,
            Handler handler
            )
        {
            var command = new Commands.Define
            {
                RoleId = context.Id()
            };
            await handler.Handle(command, context).ConfigureAwait(false);

            context.UoW.Check <Role>(context.Id()).Raised <Events.Defined>();
        }
Exemplo n.º 2
0
        public async Task Handle(Commands.Define command, IMessageHandlerContext ctx)
        {
            var role = await ctx.For <Role>().New(command.RoleId).ConfigureAwait(false);

            role.Define(command.Name);
        }