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