Esempio n. 1
0
        public void CashFlowSize()
        {
            ITimeSeries sampleTimeSeries = new MockTimeSeries(1, 2, 3, 4, 5);
            CashFlow    cashFlow         = new CashFlow(sampleTimeSeries, new BaseTradingRecord());

            Assert.AreEqual(5, cashFlow.GetSize());
        }
Esempio n. 2
0
        public void cashFlowValueWithOnlyOneTradeAndAGapAfter()
        {
            ITimeSeries    sampleTimeSeries = new MockTimeSeries(1, 2, 2);
            ITradingRecord tradingRecord    = new BaseTradingRecord(Order.buyAt(0, sampleTimeSeries), Order.sellAt(1, sampleTimeSeries));

            CashFlow cashFlow = new CashFlow(sampleTimeSeries, tradingRecord);

            Assert.AreEqual(3, cashFlow.GetSize());
            Assert.AreEqual(cashFlow.GetValue(0), 1);
            Assert.AreEqual(cashFlow.GetValue(1), 2);
            Assert.AreEqual(cashFlow.GetValue(2), 2);
        }