Пример #1
0
        public void AsString_CorrectlyHandlesSingleDigitDaysAndMonths()
        {
            TradeDate tradeDateOne = new TradeDate(new DateTime(2018, 4, 6), false, false, false);

            var dateString = tradeDateOne.AsString();

            dateString.Should().Be("2018-04-06");
        }
Пример #2
0
        public void AsString_ReturnsDateString_InYYYYMMDDFormat()
        {
            TradeDate tradeDateOne = new TradeDate(new DateTime(2018, 12, 31), true, true, true);

            var dateString = tradeDateOne.AsString();

            dateString.Should().Be("2018-12-31");
        }
Пример #3
0
        internal Result <List <SecurityPrice> > GetSecurityPrices(TradeDate tradeDate)
        {
            var securityPrices = _securityPriceRepository.GetSecurityPrices(tradeDate);

            return((!securityPrices.IsNullOrEmpty()) ?
                   Result <List <SecurityPrice> > .Success(securityPrices)
                : Result.Failure <List <SecurityPrice> >(new MissingDataError($"No security price data exists for the trade date {tradeDate.AsString()}.  Check to see if the data has been loaded or is missing")));
        }