public void RequestInfoTest()
        {
            string referenceDataResponse = "";
            var handler = new BloombergReferenceDataHandlerMock(referenceDataResponse);
            string field = "PX_BID";
            string security = "DE000CZ36U01@CBED CORP";

            handler.AddField(field);
            handler.AddSecurity(security);

            Assert.AreEqual(1, handler.RequestInfo.Fields.Count);
            Assert.AreEqual(1, handler.RequestInfo.Tickers.Count);

            Assert.AreEqual(security, handler.RequestInfo.Tickers[0]);
            Assert.AreEqual(field, handler.RequestInfo.Fields[0]);
        }
Esempio n. 2
0
        public void RequestInfoTest()
        {
            string referenceDataResponse = "";
            var    handler  = new BloombergReferenceDataHandlerMock(referenceDataResponse);
            string field    = "PX_BID";
            string security = "DE000CZ36U01@CBED CORP";

            handler.AddField(field);
            handler.AddSecurity(security);

            Assert.AreEqual(1, handler.RequestInfo.Fields.Count);
            Assert.AreEqual(1, handler.RequestInfo.Tickers.Count);

            Assert.AreEqual(security, handler.RequestInfo.Tickers[0]);
            Assert.AreEqual(field, handler.RequestInfo.Fields[0]);
        }
        public void ParseValidRequestTest()
        {
            string referenceDataResponse = "ReferenceDataResponse={}";

            var handler = new BloombergReferenceDataHandlerMock(referenceDataResponse);
            handler.AddField("PX_BID");
            handler.AddSecurity("DE000CZ36U01@CBED CORP");

            var response = new ReferenceDataResponse(handler.RequestInfo);

            var message = new TweakMessage();

            response.SaveMessage(message);

            Assert.AreEqual(1, handler.Fields.Count);
            Assert.AreEqual(1, handler.Tickers.Count);
            Assert.AreEqual(1, response.Fields.Count);
            Assert.AreEqual(1, response.Securities.Count);
        }
Esempio n. 4
0
        public void ParseValidRequestTest()
        {
            string referenceDataResponse = "ReferenceDataResponse={}";

            var handler = new BloombergReferenceDataHandlerMock(referenceDataResponse);

            handler.AddField("PX_BID");
            handler.AddSecurity("DE000CZ36U01@CBED CORP");

            var response = new ReferenceDataResponse(handler.RequestInfo);

            var message = new TweakMessage();

            response.SaveMessage(message);

            Assert.AreEqual(1, handler.Fields.Count);
            Assert.AreEqual(1, handler.Tickers.Count);
            Assert.AreEqual(1, response.Fields.Count);
            Assert.AreEqual(1, response.Securities.Count);
        }