Пример #1
0
        public void CanTestIfDataPresent()
        {
            var data = _randomizer.Next();
            var date = DateTime.Now.AddDays(-1 * _randomizer.Next(2, 30));

            var container = new DayData <int>(int.MinValue);

            container.AddDay(DATA_TYPE, date, data);
            container.ContainsDataForDate(DATA_TYPE, date).Should().BeTrue();
            container.ContainsDataForDate(DATA_TYPE, date.AddDays(1)).Should().BeFalse();
            container.ContainsDataForDate(nameof(this.CanTestIfDataPresent), date).Should().BeFalse();
            container.ContainsDataForDate(nameof(this.CanTestIfDataPresent), date.AddDays(1)).Should().BeFalse();
        }
Пример #2
0
        public int GetData(string dataType, DateTime date)
        {
            if (_shortData.ContainsDataForDate(dataType, date))
            {
                return(_shortData.GetData(dataType, date));
            }

            if (_intData.ContainsDataForDate(dataType, date))
            {
                return(_intData.GetData(dataType, date));
            }

            return(int.MinValue);
        }