public void ShouldNotExpandWhenDateIsEarlierThanStartingDate() { // For DateTimeRange currentRange = new DateTimeRange { Start = new DateTime(2020, 04, 01), End = new DateTime(2020, 04, 30) }; DateTimeRange newRange = currentRange; // Given newRange.ExpandTo(new DateTime(2020, 03, 15)); // Assert }
public void ShouldNotExpandWhenDateIsPartOfCurrentRange() { // For DateTimeRange currentRange = new DateTimeRange { Start = new DateTime(2020, 04, 01), End = new DateTime(2020, 04, 30) }; DateTimeRange newRange = currentRange; // Given newRange.ExpandTo(new DateTime(2020, 04, 15)); // Assert Assert.AreEqual(newRange.Start, currentRange.Start); Assert.AreEqual(newRange.End, currentRange.End); }
public void ShouldExpandWhenDateIsOlderThanCurrentRange() { // For DateTimeRange currentRange = new DateTimeRange { Start = new DateTime(2020, 04, 01), End = new DateTime(2020, 04, 30) }; DateTimeRange newRange = currentRange; // Given DateTime date = new DateTime(2020, 06, 30); newRange.ExpandTo(date); // Assert Assert.AreEqual(newRange.Start, currentRange.Start); Assert.AreEqual(newRange.End, date); }