Пример #1
0
        public void IsAvailable_ShouldReturnFalse_WhenDate_IsBefore_StartDate()
        {
            var model = new EnabledForBase
            {
                Properties = new EnabledForProperties
                {
                    Start = DateTime.Now.AddDays(+1),
                    End   = DateTime.Now.AddDays(+2)
                }
            };

            Assert.False(_timeWindow.IsAvailable(model));
        }
Пример #2
0
        public void IsAvailable_ShouldReturnTrue_WhenDate_IsBetween_Start_And_End_Date()
        {
            var model = new EnabledForBase
            {
                Properties = new EnabledForProperties
                {
                    Start = DateTime.Now.AddDays(-1),
                    End   = DateTime.Now.AddDays(+1)
                }
            };

            Assert.True(_timeWindow.IsAvailable(model));
        }
Пример #3
0
 public bool IsAvailable(EnabledForBase enabledFor)
 => UTCTime > enabledFor.Properties.Start && UTCTime < enabledFor.Properties.End;