Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }