Пример #1
0
 public static CommandsController FooCommandsService(Func<object, CommandHandlingContext, Task> delegatex)
 {
     var instance = new CommandsController(new ServerContext
     (
         registry: new FooCommandRegistry(),
         broker: new DelegatingCommandBroker(delegatex)
     ));
     return instance;
 }
 public void Given_service_by_default()
 {
     _broker = new CommandBrokerStub();
     var service = new CommandsController(new ServerContext(broker: _broker));
     var cmdKey = typeof(FooCommand).FullName;
     var cmdData = new JObject
     {
         {"Value1", "Foo"}
     };
     _result = service.Default(new PostCommandRequest
     {
         Key = cmdKey,
         Command = cmdData
     });
 }
 public void Given_service_by_default()
 {
     var controller = new CommandsController(new ServerContext(broker: new CommandBrokerStub()));
     _result = controller.Default("");
 }