示例#1
0
        public void testIsolatedAimMessages()
        {
            O.freezeNow("07/01/2009");
            MarketTickersTable.TICKERS.C_BLOOMBERG.updateOne(MarketTickersTable.TICKERS.C_MARKET.@is("FV.1C"), "anything");
            MarketTickersTable.TICKERS.C_BLOOMBERG.updateOne(MarketTickersTable.TICKERS.C_MARKET.@is("TU.1C"), "TOE");
            var fvTopic     = LiveWatcher.tickerTopic("QF.NDayBreak", "anything", "Comdty");
            var tuTopic     = LiveWatcher.tickerTopic("QF.NDayBreak", "TOE", "Comdty");
            var brokenTopic = LiveWatcher.tickerTopic("QF.NDayBreak", "BROKE", "Comdty");
            var fakeGui     = new FakeWatcherGui();
            var watcher     = new LiveWatcher(fakeGui);

            watcher.initialize();
            watcher.eachRow(row => AreEqual(row["aim"], 0));
            watcher.requireContains("QF.NDayBreak", "anything Comdty");
            var fv1C = new Symbol("FV.1C");
            var tu1C = new Symbol("TU.1C");
            Action <Symbol, double> waitForCount = (symbol, expected) => fakeGui.waitMatches(expected, () => watcher.row("QF.NDayBreak", symbol)["aim"]);

            publishAim(fvTopic, "QF.NDayBreak", "anything", "COMDTY", 3, "2009/07/01 14:00:00");
            waitForCount(fv1C, 3);
            publishAim(fvTopic, "QF.NDayBreak", "anything", "COMDTY", 2, "2009/07/01 14:00:01");
            waitForCount(fv1C, 2);
            publishAim(tuTopic, "QF.NDayBreak", "TOE", "COMDTY", 5, "2009/07/01 14:00:03");
            waitForCount(tu1C, 5);
            publishAim(brokenTopic, "QF.NDayBreak", "BROKE", "COMDTY", 7, "2009/07/01 14:00:03");
            fakeGui.waitMatches(7.0, () => watcher.firstRow()["aim"]);
            AreEqual(watcher.firstRow()["symbol"], "BROKE Comdty");
        }
示例#2
0
        public void testIsolatedTomahawkMessages()
        {
            O.freezeNow("07/01/2009");
            MarketTickersTable.TICKERS.C_BLOOMBERG.updateOne(MarketTickersTable.TICKERS.C_MARKET.@is("FV.1C"), "anything");
            var nday20  = new Topic("TOMAHAWK.NDayBreak.1.0.daily.BFBD20.FV.1C.optimalPosition");
            var nday30  = new Topic("TOMAHAWK.NDayBreak.1.0.daily.BFBD30.FV.1C.optimalPosition");
            var fakeGui = new FakeWatcherGui();
            var watcher = new LiveWatcher(fakeGui);

            watcher.initialize();
            watcher.eachRow(row => AreEqual(row["tomahawk"], 0));
            watcher.requireContains("QF.NDayBreak", "anything Comdty");
            var             fv1C         = new Symbol("FV.1C");
            Action <double> waitForCount = expected => fakeGui.waitMatches(expected, () => watcher.row("QF.NDayBreak", fv1C)["tomahawk"]);

            publishTomahawk(nday20, 3, "2009/07/01 14:00:00");
            waitForCount(3);
            publishTomahawk(nday20, 2, "2009/07/01 14:00:01");
            waitForCount(2);
            publishTomahawk(nday30, 3, "2009/07/01 14:00:03");
            waitForCount(5);
        }