public async Task supported_command_types() { var processor = new AsyncCommandProcessor(new AsyncCommandHandler()); processor.CommandTypes.Should().BeEmpty(because: "not called yet."); (await processor.Send(new EmptyCommand())).Should().BeValid(); processor.CommandTypes.Should().BeEquivalentTo(new[] { typeof(EmptyCommand) }, because: "empty command is supported."); }
/// <summary> /// Forwards by the specific the topic and waits until another command /// with the same key and target definded by the intial source is received. /// </summary> /// <param name="srcId">The source identifier.</param> /// <param name="cmd">The command.</param> /// <param name="topic">The topic.</param> public static async Task <Command> ForwardByTopicAndWaitForResponse(string srcId, Command cmd, string topic, int timeout = 60) { cmd.SenderId = srcId; ForwardByTopic(cmd, topic); return(await AsyncCommandProcessor.ProcessCommand(cmd, timeout)); }