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)); }
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)); }
public bool IsAvailable(EnabledForBase enabledFor) => UTCTime > enabledFor.Properties.Start && UTCTime < enabledFor.Properties.End;