public void IncrementPeriodTest() { TimeCollectionDateFilter filter = new TimeCollectionDateFilter(); filter.StartDate = new DateTime(2015, 1, 10); filter.EndDate = new DateTime(2015, 1, 14); filter.Increment(); Assert.AreEqual(new DateTime(2015, 1, 15), filter.StartDate, "Incorrect start date."); Assert.AreEqual(new DateTime(2015, 1, 19), filter.EndDate, "Incorrect end date."); }
public void IncrementNotifiesFilterText() { TimeCollectionDateFilter filter = new TimeCollectionDateFilter(); filter.StartDate = new DateTime(2015, 1, 10); filter.EndDate = new DateTime(2015, 1, 14); // Subscribe bool notified = false; filter.PropertyChanged += (s, e) => { if (e.PropertyName == "FilterText") { notified = true; } }; filter.Increment(); Assert.IsTrue(notified); }