開発に使用するリポジトリ
Revisión | f01439f091f5cffa750fe6d67c534ea8a141c069 (tree) |
---|---|
Tiempo | 2012-12-06 16:51:00 |
Autor | the40san <oss.ma40@gmai...> |
Commiter | the40san |
ApiInformationTest������ƒlj�
@@ -32,7 +32,59 @@ namespace OpenTween | ||
32 | 32 | [TestFixture] |
33 | 33 | public class ApiInformationTest |
34 | 34 | { |
35 | + [Test] | |
36 | + public void Initialize() | |
37 | + { | |
38 | + ApiInformation apiinfo = new ApiInformation(); | |
39 | + apiinfo.Initialize(); | |
35 | 40 | |
41 | + Assert.That(apiinfo.HttpHeaders["X-RateLimit-Remaining"], Is.EqualTo(-1)); | |
42 | + Assert.That(apiinfo.HttpHeaders["X-RateLimit-Limit"], Is.EqualTo(-1)); | |
43 | + Assert.That(apiinfo.HttpHeaders["X-RateLimit-Reset"], Is.EqualTo(-1)); | |
36 | 44 | |
45 | + Assert.That(apiinfo.HttpHeaders["X-Access-Level"], Is.EqualTo("read-write-directmessages")); | |
46 | + | |
47 | + Assert.That(apiinfo.HttpHeaders["X-MediaRateLimit-Remaining"], Is.EqualTo(-1)); | |
48 | + Assert.That(apiinfo.HttpHeaders["X-MediaRateLimit-Limit"], Is.EqualTo(-1)); | |
49 | + Assert.That(apiinfo.HttpHeaders["X-MediaRateLimit-Reset"], Is.EqualTo(-1)); | |
50 | + | |
51 | + | |
52 | + } | |
53 | + | |
54 | + [Test] | |
55 | + [Combinatorial] | |
56 | + public void MaxCountTest([Values(100,0,-100)]int value) | |
57 | + { | |
58 | + ApiInformation apiinfo = new ApiInformation(); | |
59 | + apiinfo.MaxCount = value; | |
60 | + Assert.That(apiinfo.MaxCount, Is.EqualTo(value)); | |
61 | + } | |
62 | + | |
63 | + | |
64 | + [TestCase(-100, Result = -100)] | |
65 | + [TestCase(-100, Result = 0)] | |
66 | + [TestCase(-100, Result = 100)] | |
67 | + [TestCase(int.MaxValue, Result = int.MaxValue)] | |
68 | + [TestCase(int.MinValue, Result = int.MinValue)] | |
69 | + public int RemainCountTest(int value) | |
70 | + { | |
71 | + ApiInformation apiinfo = new ApiInformation(); | |
72 | + apiinfo.RemainCount = value; | |
73 | + return apiinfo.RemainCount; | |
74 | + } | |
75 | + | |
76 | + [Test] | |
77 | + public void ConvertResetTimeInSecondsToResetTimeTest() | |
78 | + { | |
79 | + ApiInformation apiinfo = new ApiInformation(); | |
80 | + DateTime d = apiinfo.ConvertResetTimeInSecondsToResetTime(-1); | |
81 | + Assert.That(d, Is.EqualTo(new DateTime())); | |
82 | + } | |
83 | + | |
84 | + | |
85 | + public void ResetTimeTest() | |
86 | + { | |
87 | + | |
88 | + } | |
37 | 89 | } |
38 | 90 | } |