public void SetReadState_MarkAsUnreadTest() { var tab = new TabClass { TabType = MyCommon.TabUsageType.UserTimeline }; tab.UnreadManage = true; tab.AddPostToInnerStorage(new PostClass { StatusId = 100L, IsRead = true, // 既読 }); tab.AddSubmit(); Assert.Equal(0, tab.UnreadCount); tab.SetReadState(100L, false); // 未読にする Assert.Equal(1, tab.UnreadCount); }
public void GetUnreadIds_Test() { var tab = new TabClass { TabType = MyCommon.TabUsageType.UserTimeline }; tab.UnreadManage = true; Assert.Empty(tab.GetUnreadIds()); tab.AddPostToInnerStorage(new PostClass { StatusId = 100L, IsRead = false }); tab.AddPostToInnerStorage(new PostClass { StatusId = 200L, IsRead = true }); tab.AddSubmit(); Assert.Equal(new[] { 100L }, tab.GetUnreadIds()); tab.SetReadState(100L, true); // 既読にする Assert.Empty(tab.GetUnreadIds()); }