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);
        }
Beispiel #2
0
        public Conversation ConversationBuilder(Envelope env)
        {
            Conversation conv = null;

            switch (env.Contents)
            {
            case StockPriceUpdate m:
                conv = new ReceiveStockUpdateConversation(m.ConversationID);

                //setup response message as mock
                mock = new Mock <ReceiveStockUpdateState>(env, conv)
                {
                    CallBase = true
                };
                conv.SetInitialState(mock.Object as ReceiveStockUpdateState);

                break;
            }

            return(conv);
        }