• R/O
  • HTTP
  • SSH
  • HTTPS

open-tween: コミット

開発に使用するリポジトリ


コミットメタ情報

リビジョン516b09f3b60a9670f78ba1c2c40a4225104f9b4e (tree)
日時2015-10-04 00:54:28
作者Kimura Youichi <kim.upsilon@bucy...>
コミッターKimura Youichi

ログメッセージ

TabInformations.SubmitUpdateの通知の優先度に関するテストコードを追加

変更サマリ

差分

--- a/OpenTween.Tests/TabInformationTest.cs
+++ b/OpenTween.Tests/TabInformationTest.cs
@@ -375,6 +375,44 @@ namespace OpenTween
375375 Assert.Equal(150L, homeTab.OldestUnreadId);
376376 }
377377
378+ [Fact]
379+ public void SubmitUpdate_NotifyPriorityTest()
380+ {
381+ var homeTab = this.tabinfo.GetTabByType(MyCommon.TabUsageType.Home);
382+ homeTab.UnreadManage = true;
383+ homeTab.SoundFile = "home.wav";
384+
385+ var replyTab = this.tabinfo.GetTabByType(MyCommon.TabUsageType.Mentions);
386+ replyTab.UnreadManage = true;
387+ replyTab.SoundFile = "reply.wav";
388+
389+ var dmTab = this.tabinfo.GetTabByType(MyCommon.TabUsageType.DirectMessage);
390+ dmTab.UnreadManage = true;
391+ dmTab.SoundFile = "dm.wav";
392+
393+ // 通常ツイート
394+ this.tabinfo.AddPost(new PostClass { StatusId = 100L, IsRead = false });
395+
396+ // リプライ
397+ this.tabinfo.AddPost(new PostClass { StatusId = 200L, IsReply = true, IsRead = false });
398+
399+ // DM
400+ dmTab.AddPostToInnerStorage(new PostClass { StatusId = 300L, IsDm = true, IsRead = false });
401+
402+ this.tabinfo.DistributePosts();
403+
404+ string soundFile;
405+ PostClass[] notifyPosts;
406+ bool isMentionIncluded, isDeletePost;
407+ this.tabinfo.SubmitUpdate(out soundFile, out notifyPosts, out isMentionIncluded, out isDeletePost, false);
408+
409+ // DM が最も優先度が高いため DM の通知音が再生される
410+ Assert.Equal("dm.wav", soundFile);
411+
412+ // 通知対象のツイートは 3 件
413+ Assert.Equal(3, notifyPosts.Length);
414+ }
415+
378416 class TestPostFilterRule : PostFilterRule
379417 {
380418 public static PostFilterRule Create(Func<PostClass, MyCommon.HITRESULT> filterDelegate)
旧リポジトリブラウザで表示