public void GetDayIntervalByDate_checkConstant_offsetLessThan_MinOffset()
        {
            var factory = new DayIntervalFactory();

            Assert.Throws <ArgumentException>(() =>
                                              factory.GetDayIntervalByDate(new DateTime(2019, 10, 10, 13, 56, 44, 123, DateTimeKind.Utc), DayIntervalFactory.MinOffset - 1));
        }
        public void GetDayIntervalByDate_DateTime_Unspecific_returnArgumentException()
        {
            var factory = new DayIntervalFactory();

            Assert.Throws <ArgumentException>(() =>
                                              factory.GetDayIntervalByDate(new DateTime(2019, 10, 10, 13, 56, 44, 123, DateTimeKind.Unspecified), 0));
        }
        public void GetDayIntervalByDate_DateTime_Local_returnTimeInterval()
        {
            var factory = new DayIntervalFactory();

            Assert.NotNull(factory.GetDayIntervalByDate(new DateTime(2019, 10, 10, 13, 56, 44, 123, DateTimeKind.Utc),
                                                        0));
        }
        public void MinOffsetCheck()
        {
            var factory          = new DayIntervalFactory();
            int MinValueShouldBe = 0;

            Assert.True(DayIntervalFactory.MinOffset == MinValueShouldBe);
        }
        public void MaxOffsetCheck()
        {
            var factory          = new DayIntervalFactory();
            int MaxValueShouldBe = 86398000;

            Assert.True(DayIntervalFactory.MaxOffset == MaxValueShouldBe);
        }
Esempio n. 6
0
        public void GetDayIntervalByDate_recivedIntervalCheck(CaseUtc someCase)
        {
            var factory          = new DayIntervalFactory();
            var returnedInterval = factory.GetDayIntervalByDate(someCase.Time, someCase.Offset);

            Assert.AreEqual(someCase.DayInterval, returnedInterval);
            Assert.AreEqual(someCase.DayInterval.Kind, returnedInterval.Kind);
        }
        public void GetDayIntervalByDate_DateTime_Local_returnTimeInterval_Local()
        {
            var factory  = new DayIntervalFactory();
            var interval = factory.GetDayIntervalByDate(new DateTime(2019, 10, 10, 13, 56, 44, 123, DateTimeKind.Local),
                                                        0);

            Assert.That(interval.Kind == DateTimeKind.Local);
            Assert.That(interval.DateTimeStart.Kind == DateTimeKind.Local);
            Assert.That(interval.DateTimeEnd.Kind == DateTimeKind.Local);
        }