Esempio n. 1
0
        public void BidCompareTestFalse()
        {
            //Create process that will count each time the AlgoAskCompare condition is "true"
            AlgoCountProcess testProcess = new AlgoCountProcess(agent, comm, commodity);

            testProcess.addCondition(new AlgoBidCompare(10 + 1));
            agent.add(testProcess);

            //Run AMA once
            agent.enable(true);
            System.Threading.Thread.Sleep(1500);
            agent.enable(false);

            //AMA ran once but condition is not met - count should be "0"
            Assert.AreEqual(0, testProcess.count);
        }
Esempio n. 2
0
        public void HasNoActiveRequestTestFalse()
        {
            //Create process that will count each time the AlgoAskCompare condition is "true"
            AlgoCountProcess testProcess = new AlgoCountProcess(agent, comm, commodity);

            testProcess.addCondition(new HasNoActiveRequest());
            testProcess.requestID = qmarketWrapper.id;
            agent.add(testProcess);

            //Run AMA once
            agent.enable(true);
            System.Threading.Thread.Sleep(1500);
            agent.enable(false);

            //AMA ran once - count should be "1"
            Assert.AreEqual(0, testProcess.count);
        }
        public void MomentumIncreaseFalse()
        {
            //Create process that will count each time the AlgoAskCompare condition is "true"
            AlgoCountProcess         testProcess          = new AlgoCountProcess(agent, comm, commodity);
            HistoryDalImplementation sqlStub              = new SQLserverMomentumStub(true);
            MomentumIncrease         momentumIncreaseCond = new MomentumIncrease(20, 10, 1); momentumIncreaseCond.sql = sqlStub;

            testProcess.addCondition(momentumIncreaseCond);
            agent.add(testProcess);

            //Run AMA once
            agent.enable(true);
            System.Threading.Thread.Sleep(1500);
            agent.enable(false);

            //AMA ran once - count should be "1"
            Assert.AreEqual(0, testProcess.count);
        }