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(); }
public void EnactCommand(CommandWithCustomAuthorization command) { }