Ejemplo n.º 1
0
        public void ProcessRequestForEquityIndexWeights()
        {
            //retrieve bdis
            var sql = @"select top 1 * from BloombergDatarequestitem where bbfieldlist like '%mwei%'  and bbticker = 'ibex index' and insertedwhen > getdate() - 5";

            var requestItems = new Database().GetTickerItemsToProcess(sql);
            var controller   = new BergController();
            //split into separate lists - one for datawarehouse, one for legacy api, one for bloomberg ad hoc
            var requestItemsForBloombergApi   = requestItems.FindAll(x => controller.IsForLegacyBloombergApi(x));
            var requestItemsForBloombergAdHoc = requestItems.FindAll(x => controller.IsForBloombergAdHoc(x));
            var requestItemsForDatawarehouse  = requestItems.FindAll(x => !controller.IsForLegacyBloombergApi(x) && !controller.IsForBloombergAdHoc(x));

            Assert.AreEqual(requestItems.Count, requestItemsForDatawarehouse.Count + requestItemsForBloombergApi.Count + requestItemsForBloombergAdHoc.Count);
            Assert.AreEqual(1, requestItemsForDatawarehouse.Count);

            //get errors
            new TestBloombergDatawarehouse().ProcessDataRequests(requestItemsForDatawarehouse);
        }
Ejemplo n.º 2
0
        public void GetDataWarehouseRequestItemsFromLiveAndProcessThemInDev()
        {
            //retrieve bdis
            var sqlFile      = @"sqls\GetBloombergDataRequestItems.sql";
            var controller   = new BergController();
            var sql          = File.ReadAllText(sqlFile);
            var requestItems = new Database().GetTickerItemsToProcess(sql);

            //split into separate lists - one for datawarehouse, one for legacy api, one for bloomberg ad hoc
            var requestItemsForBloombergApi   = requestItems.FindAll(x => controller.IsForLegacyBloombergApi(x));
            var requestItemsForBloombergAdHoc = requestItems.FindAll(x => controller.IsForBloombergAdHoc(x));
            var requestItemsForDatawarehouse  = requestItems.FindAll(x => !controller.IsForLegacyBloombergApi(x) && !controller.IsForBloombergAdHoc(x));

            Assert.AreEqual(requestItems.Count, requestItemsForDatawarehouse.Count + requestItemsForBloombergApi.Count + requestItemsForBloombergAdHoc.Count);

            //get errors

            new TestBloombergDatawarehouse().ProcessDataRequests(requestItemsForDatawarehouse);
        }
Ejemplo n.º 3
0
        public void RequestItemRoutingTests()
        {
            var controller = new BergController();

            var requestItem = new RequestItem
            {
                BBFieldList = "PX_LAST",
                RequestType = BloombergDataInstrument.eRequestType.IntraDayBar,
                UserId      = "IntradayPrices"
            };

            Assert.IsTrue(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "PX_LAST",
                RequestType = BloombergDataInstrument.eRequestType.IntraDayTick,
                UserId      = "IntradayFx"
            };
            Assert.IsTrue(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "PX_LAST",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "PX_LAST,OPT_DELTA_SOMETHING",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "SW_VAL_PREMIUM....",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "nSW_VAL_PREMIUM....",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "RTG_....",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "RTG....",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "kjhjkh jkhCALENDAR_NON_SETTLEMENT_DATEskjhjkh",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            requestItem = new RequestItem
            {
                BBFieldList = "kjhjkh jkhCALENDAR_NON_SETTLEMENT_DATESkjhjkh",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = ""
            };
            Assert.IsFalse(controller.IsForLegacyBloombergApi(requestItem));

            //adhoc test
            requestItem = new RequestItem
            {
                BBFieldList = "kjhjkh jkhCALENDAR_NON_SETTLEMENT_DATESkjhjkh",
                RequestType = BloombergDataInstrument.eRequestType.Reference,
                UserId      = "StaticDataImport"
            };
            Assert.IsTrue(controller.IsForBloombergAdHoc(requestItem));
        }