public void NextUnreadIndex_DisabledTest() { var tab = new TabClass { TabType = MyCommon.TabUsageType.UserTimeline }; tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); // 未読表示無効 tab.UnreadManage = false; tab.AddPostToInnerStorage(new PostClass { StatusId = 100L, IsRead = false, // 未読 }); tab.AddSubmit(); Assert.Equal(-1, tab.NextUnreadIndex); }
public void NextUnreadId_SortByIdAscTest() { var tab = new TabClass { TabType = MyCommon.TabUsageType.UserTimeline }; tab.UnreadManage = true; // ID の昇順でソート tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); // 画面には上から 100 → 200 → 300 の順に並ぶ tab.AddPostToInnerStorage(new PostClass { StatusId = 100L, IsRead = false }); tab.AddPostToInnerStorage(new PostClass { StatusId = 200L, IsRead = false }); tab.AddPostToInnerStorage(new PostClass { StatusId = 300L, IsRead = false }); tab.AddSubmit(); // 昇順/降順に関わらず、ID の小さい順に未読の ID を返す Assert.Equal(100L, tab.NextUnreadId); }
public void NextUnreadId_SortByScreenNameDescTest() { var tab = new TabClass { TabType = MyCommon.TabUsageType.UserTimeline }; tab.UnreadManage = true; // ScreenName の降順でソート tab.SetSortMode(ComparerMode.Name, SortOrder.Descending); // 画面には上から 300 → 100 → 200 の順に並ぶ tab.AddPostToInnerStorage(new PostClass { StatusId = 100L, ScreenName = "bbb", IsRead = false }); tab.AddPostToInnerStorage(new PostClass { StatusId = 200L, ScreenName = "aaa", IsRead = false }); tab.AddPostToInnerStorage(new PostClass { StatusId = 300L, ScreenName = "ccc", IsRead = false }); tab.AddSubmit(); // 昇順/降順に関わらず、ScreenName の辞書順で小さい順に未読の ID を返す Assert.Equal(200L, tab.NextUnreadId); }