public async Task BCRPFindCmdOK() { var cmd = new Cmd(); var cmd2 = new Cmd2(); var processor = new CommandRequestProcessorTest(new List <ICommand> { cmd, cmd2 }); var request = new BaseCommandBotRequest <JToken>(null, cmd.UniqueName, JToken.FromObject(new DiscussCommandBotRequest()), null, null, BotCommandContext.DiscussPostForm); await processor.ProcessAsync(request); Assert.IsTrue(cmd.DiscussCmdExecuted); Assert.IsFalse(cmd.EventCmdExecuted); Assert.IsFalse(cmd.MesCmdExecuted); cmd.DiscussCmdExecuted = false; request.ctx = BotCommandContext.EventPostForm; await processor.ProcessAsync(request); Assert.IsFalse(cmd.DiscussCmdExecuted); Assert.IsTrue(cmd.EventCmdExecuted); Assert.IsFalse(cmd.MesCmdExecuted); cmd.EventCmdExecuted = false; request.ctx = BotCommandContext.MessagingPostForm; await processor.ProcessAsync(request); Assert.IsFalse(cmd.DiscussCmdExecuted); Assert.IsFalse(cmd.EventCmdExecuted); Assert.IsTrue(cmd.MesCmdExecuted); }
public HttpResponseMessage GetCarsForCmd2(string foo, int bar, [FromUri] Cmd2 cmd) { return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("Default Car for Cmd2") }); }
public async Task BCRPNotFoundCtxCmdFail() { var cmd = new Cmd(); var cmd2 = new Cmd2(); var processor = new CommandRequestProcessorTest(new List <ICommand> { cmd, cmd2 }); var response = await processor.ProcessAsync(new BaseCommandBotRequest <JToken>(null, cmd.UniqueName, JToken.FromObject(new DiscussCommandBotRequest()), null, null, (BotCommandContext)5)); CheckFailResponse(response); }
int Foo2(Cmd2 cmd) { return(cmd()); }
int Foo2 (Cmd2 cmd) { return cmd (); }