public static Conversation Builder(Envelope env) { Conversation conv = null; switch (env.Contents) { case UpdateLeaderBoardMessage m: conv = new ReceiveLeaderboardUpdateConversation(m.ConversationID); conv.SetInitialState(new ReceiveLeaderboardUpdateState(env, conv)); break; case StockPriceUpdate m: conv = new ReceiveStockUpdateConversation(m.ConversationID); conv.SetInitialState(new ReceiveStockUpdateState(env, conv)); break; } return(conv); }
public Conversation ConversationBuilder(Envelope env) { Conversation conv = null; switch (env.Contents) { case UpdateLeaderBoardMessage m: conv = new ReceiveLeaderboardUpdateConversation(m.ConversationID); //setup response message as mock mock = new Mock <ReceiveLeaderboardUpdateState>(env, conv) { CallBase = true }; conv.SetInitialState(mock.Object as ReceiveLeaderboardUpdateState); break; } return(conv); }