Beispiel #1
0
        public void EnrichData_Expected_FirstTimePeriodIsBeginingOfTheDay()
        {
            // Arrange
            var powerTrade = new Fixture().Create <PowerTrade>();

            powerTrade.Date = powerTrade.Date.Date;

            // Act
            var result = DateTimeManager.EnrichDataWithDates(powerTrade);

            // Assert
            TimeSpan.TryParse(result.First().Period, out TimeSpan firstTimePeriod);
            var beginingOfDayUtc = DateTimeManager.CalculateBegginingOfReportingDayUtc(powerTrade.Date).TimeOfDay;

            Assert.AreEqual(firstTimePeriod, beginingOfDayUtc);
        }
Beispiel #2
0
        [TestCase("10/26/2014 00:00:00.000")] // Russia long day
        public void EnrichDataLongDay_Expected_LastPeriodIsNotDuplicateOfFirstPeriod(DateTime date)
        {
            // Arrange
            PowerTrade powerTrade;

            if (TimeZoneInfo.Local.IsDaylightSavingTime(date))
            {
                powerTrade = TestHelper.BuildPowerTradesCollection(1, 25, date).First();
            }
            else
            {
                powerTrade = TestHelper.BuildPowerTradesCollection(1, 24, date).First();
            }

            // Act
            var result = DateTimeManager.EnrichDataWithDates(powerTrade);

            // Assert
            Assert.AreNotEqual(result.First().Period, result.Last().Period);
        }