public Conversation ConversationBuilder(Envelope env) { Conversation conv = null; switch (env.Contents) { case StockHistoryRequestMessage m: conv = new StockHistoryResponseConversation(env); mock = new Mock <StockHistoryResponseState>(env, conv) { CallBase = true }; conv.SetInitialState(mock.Object as StockHistoryResponseState); break; } return(conv); }
public static Conversation ConversationBuilder(Envelope e) { Conversation conv = null; switch (e.Contents) { case StockHistoryRequestMessage m: conv = new StockHistoryResponseConversation(e); conv.SetInitialState(new StockHistoryResponseState(e as TcpEnvelope, conv)); break; case StockStreamRequestMessage m: conv = new StockStreamResponseConversation(m.ConversationID); conv.SetInitialState(new StockStreamResponseState(e, conv)); break; } return(conv); }