コード例 #1
0
        public void GetStartOfChargePeriod_Tests_SameAsStartTime()
        {
            var businessHours = new ChargeableHours(8, 0, 18, 0);
            var checkIn       = new DateTime(2021, 3, 17, 13, 0, 0);

            Assert.AreEqual(businessHours.GetStartOfChargePeriod(checkIn), checkIn);
        }
コード例 #2
0
        public void GetStartOfChargePeriod_Tests_WeekdayBeforeStartTime()
        {
            var businessHours = new ChargeableHours(8, 0, 18, 0);
            var checkIn       = new DateTime(2021, 3, 17, 3, 0, 0);
            var expected      = new DateTime(2021, 3, 17, 8, 0, 0);

            Assert.AreEqual(businessHours.GetStartOfChargePeriod(checkIn), expected);
        }
コード例 #3
0
        public void GetStartOfChargePeriod_Tests_Weekends(
            int inYear, int inMonth, int inDay, int inHour, int inMinute, int inSecond)
        {
            var businessHours = new ChargeableHours(8, 0, 18, 0);
            var checkIn       = new DateTime(inYear, inMonth, inDay, inHour, inMinute, inSecond);
            var expected      = new DateTime(2021, 3, 15, 8, 0, 0);

            Assert.AreEqual(businessHours.GetStartOfChargePeriod(checkIn), expected);
        }