public void OneTickBefore_UndefinedRange__Throws()
 {
     Should.Throw <ArgumentException>(() => DateTimeOperations.OneTickBefore(DateTime.Now, new StockPricesData(0)
     {
         Range = StockDataRange.Undefined, IntrradayInterval = 0
     }));
 }
示例#2
0
        private StockPricesData OnPrependChartData(StockDisplayData displayData)
        {
            DateTime ts = DateTimeOperations.OneTickBefore(displayData.TsFrom, displayData.Prices);

            displayData.TsFrom = ts.AddDays(-1).AddYears(-1);
            return(_dataProvider.GetPricesData(displayData.Stock, displayData.Prices.Range, 0, displayData.TsFrom, ts));
        }
 public void OneTickBefore__ReturnsCorrectly(int tsY, int tsM, int tsD, int tsH, int tsMM, StockDataRange stockDataRange, int interadayInterval
                                             , int etsY, int etsM, int etsD, int etsH, int etsMM)
 {
     DateTimeOperations.OneTickBefore(new DateTime(tsY, tsM, tsD, tsH, tsMM, 0), new StockPricesData(0)
     {
         Range = stockDataRange, IntrradayInterval = interadayInterval
     })
     .ShouldBe(new DateTime(etsY, etsM, etsD, etsH, etsMM, 0));
 }