public void Constructor_loads_persisted_setting(DiffListSortType persistedSetting) { AppSettings.DiffListSorting = persistedSetting; var service = new DiffListSortService(); Assert.AreEqual(persistedSetting, service.DiffListSorting); }
public void Changing_the_sort_modifies_persistence(DiffListSortType sortType) { var service = new DiffListSortService(); service.DiffListSorting = sortType; Assert.AreEqual(sortType, AppSettings.DiffListSorting); }
public void Change_notifications_occur_when_sort_is_changed() { var service = new DiffListSortService(); service.DiffListSorting = DiffListSortType.FilePath; var raisedCount = 0; service.DiffListSortingChanged += (s, e) => raisedCount++; service.DiffListSorting = DiffListSortType.FilePath; Assert.AreEqual(0, raisedCount, "Service sort did not change. It should not have raised a notification."); service.DiffListSorting = DiffListSortType.FileExtension; Assert.AreEqual(1, raisedCount, "Service sort changed. It should not have raised a single notification."); service.DiffListSorting = DiffListSortType.FileExtension; Assert.AreEqual(1, raisedCount, "Service sort did not change. It should not have raised another notification."); service.DiffListSorting = DiffListSortType.FileStatus; Assert.AreEqual(2, raisedCount, "Service sort changed. It should not have raised a second notification."); }