コード例 #1
0
        public void Authorization_can_be_specified_in_the_command_class()
        {
            var command = new CommandWithCustomAuthorization
            {
                Authorized = () => false
            };

            command.Invoking(c => c.ApplyTo(new FakeAggregateWithEnactCommandConvention()))
            .ShouldThrow <CommandAuthorizationException>();

            command.Authorized = () => true;

            command.Invoking(c => c.ApplyTo(new FakeAggregateWithEnactCommandConvention()))
            .ShouldNotThrow();
        }
コード例 #2
0
 public void EnactCommand(CommandWithCustomAuthorization command)
 {
 }