• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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


Commit MetaInfo

Revisión8339e3c6dce9c525c935494a29ed01aa35b2b0e9 (tree)
Tiempo2012-12-30 22:56:19
AutorKimura Youichi <kim.upsilon@bucy...>
CommiterKimura Youichi

Log Message

PostClassテストコード修正

Cambiar Resumen

Diferencia incremental

--- a/OpenTween.Tests/PostClassTest.cs
+++ b/OpenTween.Tests/PostClassTest.cs
@@ -74,18 +74,24 @@ namespace OpenTween
7474 }
7575 }
7676
77- private static Dictionary<long, PostClass> TestCases = new Dictionary<long, PostClass>
77+ private static Dictionary<long, PostClass> TestCases;
78+
79+ [SetUp]
80+ public void SetUpTestCases()
7881 {
79- {1L, new TestPostClass(statusId: 1L)},
80- {2L, new TestPostClass(statusId: 2L, IsFav: true)},
81- {3L, new TestPostClass(statusId: 3L, IsFav: false, RetweetedId: 2L)},
82- };
82+ PostClassTest.TestCases = new Dictionary<long, PostClass>
83+ {
84+ {1L, new TestPostClass(statusId: 1L)},
85+ {2L, new TestPostClass(statusId: 2L, IsFav: true)},
86+ {3L, new TestPostClass(statusId: 3L, IsFav: false, RetweetedId: 2L)},
87+ };
88+ }
8389
8490 [Test]
8591 public void CloneTest()
8692 {
8793 var post = new PostClass();
88- var clonePost = ((ICloneable)post).Clone() as PostClass;
94+ var clonePost = post.Clone();
8995
9096 TestUtils.CheckDeepCloning(post, clonePost);
9197 }
@@ -103,12 +109,26 @@ namespace OpenTween
103109 [TestCase(1L, Result = false)]
104110 [TestCase(2L, Result = true)]
105111 [TestCase(3L, Result = true)]
106- public bool IsFavTest(long statusId)
112+ public bool GetIsFavTest(long statusId)
107113 {
108114 return PostClassTest.TestCases[statusId].IsFav;
109115 }
110116
111117 [Test, Combinatorial]
118+ public void SetIsFavTest(
119+ [Values(2L, 3L)] long statusId,
120+ [Values(true, false)] bool isFav)
121+ {
122+ var post = PostClassTest.TestCases[statusId];
123+
124+ post.IsFav = isFav;
125+ Assert.That(post.IsFav, Is.EqualTo(isFav));
126+
127+ if (post.RetweetedId != 0)
128+ Assert.That(PostClassTest.TestCases[post.RetweetedId].IsFav, Is.EqualTo(isFav));
129+ }
130+
131+ [Test, Combinatorial]
112132 public void StateIndexTest(
113133 [Values(true, false)] bool protect,
114134 [Values(true, false)] bool mark,