public void NestedObject()
        {
            var bar = new Bar();
            bar.Foo.Name = "spam";
            var converter = new JsonMessageConverter();
            var message = converter.ToMessage(bar, new MessageProperties());

            var marshalled = (Bar)converter.FromMessage(message);
            Assert.AreEqual(bar, marshalled);
        }
        public void SimpleTrade()
        {
            var trade = new SimpleTrade();
            trade.AccountName = "Acct1";
            trade.IsBuyRequest = true;
            trade.OrderType = "Market";
            trade.Price = new decimal(103.30);
            trade.Quantity = 100;
            trade.RequestId = "R123";
            trade.Ticker = "VMW";
            trade.UserName = "******";
            var converter = new JsonMessageConverter();
            var message = converter.ToMessage(trade, new MessageProperties());

            var marshalledTrade = (SimpleTrade)converter.FromMessage(message);
            Assert.AreEqual(trade, marshalledTrade);
        }
 public void Hashtable()
 {
     var hashtable = new Dictionary<string, object>();
     hashtable.Add("TICKER", "VMW");
     hashtable.Add("PRICE", "103.2");
     var converter = new JsonMessageConverter();
     var message = converter.ToMessage(hashtable, new MessageProperties());
     var marhsalledHashtable = (Dictionary<string, object>)converter.FromMessage(message);
     Assert.AreEqual("VMW", marhsalledHashtable["TICKER"]);
     Assert.AreEqual("103.2", marhsalledHashtable["PRICE"]);
 }