forked from BenFradet/RiotSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSummonerTest.cs
222 lines (181 loc) · 6.46 KB
/
SummonerTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RiotSharp;
using RiotSharp.StatsEndpoint;
using RiotSharp.SummonerEndpoint;
using System;
using System.Configuration;
using System.Linq;
namespace RiotSharpTest
{
[TestClass]
public class SummonerTest
{
private static string apiKey = ConfigurationManager.AppSettings["ApiKey"];
private static int id = int.Parse(ConfigurationManager.AppSettings["Summoner1Id"]);
private static int championId = int.Parse(ConfigurationManager.AppSettings["ChampionId"]);
private static Region region = (Region)Enum.Parse(typeof(Region), ConfigurationManager.AppSettings["Region"]);
private static RiotApi api = RiotApi.GetInstance(apiKey);
private static Summoner summoner = api.GetSummoner(region, id);
private static Queue queue = Queue.RankedSolo5x5;
[TestMethod]
[TestCategory("Summoner")]
public void GetRunePages_Test()
{
var runePages = summoner.GetRunePages();
Assert.IsNotNull(runePages);
Assert.IsTrue(runePages.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetRunePagesAsync_Test()
{
var runePages = summoner.GetRunePagesAsync();
Assert.IsNotNull(runePages.Result);
Assert.IsTrue(runePages.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetMasteryPages_Test()
{
var masteryPages = summoner.GetMasteryPages();
Assert.IsNotNull(masteryPages);
Assert.IsTrue(masteryPages.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetMasteryPagesAsync_Test()
{
var masteryPages = summoner.GetMasteryPagesAsync();
Assert.IsNotNull(masteryPages.Result);
Assert.IsTrue(masteryPages.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetRecentGames_Test()
{
var games = summoner.GetRecentGames();
Assert.IsNotNull(games);
Assert.IsTrue(games.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetRecentGamesAsync_Test()
{
var games = summoner.GetRecentGamesAsync();
Assert.IsNotNull(games.Result);
Assert.IsTrue(games.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetLeagues_Test()
{
var leagues = summoner.GetLeagues();
Assert.IsNotNull(leagues);
Assert.IsTrue(leagues.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetLeaguesAsync_Test()
{
var leagues = summoner.GetLeaguesAsync();
Assert.IsNotNull(leagues.Result);
Assert.IsTrue(leagues.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetEntireLeagues_Test()
{
var leagues = summoner.GetEntireLeagues();
Assert.IsNotNull(leagues);
Assert.IsTrue(leagues.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetEntireLeaguesAsync_Test()
{
var leagues = summoner.GetEntireLeaguesAsync();
Assert.IsNotNull(leagues.Result);
Assert.IsTrue(leagues.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetStatsSummaries_Test()
{
var stats = summoner.GetStatsSummaries(Season.Season3);
Assert.IsNotNull(stats);
Assert.IsTrue(stats.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetStatsSummariesAsync_Test()
{
var stats = summoner.GetStatsSummariesAsync(Season.Season3);
Assert.IsNotNull(stats.Result);
Assert.IsTrue(stats.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetStatsSummaries_CurrentSeason_Test()
{
var stats = summoner.GetStatsSummaries();
Assert.IsNotNull(stats);
Assert.IsTrue(stats.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetStatsSummariesAsync_CurrentSeason_Test()
{
var stats = summoner.GetStatsSummariesAsync();
Assert.IsNotNull(stats.Result);
Assert.IsTrue(stats.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetStatsRanked_Test()
{
var stats = summoner.GetStatsRanked(Season.Season2015);
Assert.IsNotNull(stats);
Assert.IsTrue(stats.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetStatsRankedAsync_Test()
{
var stats = summoner.GetStatsRankedAsync(Season.Season2015);
Assert.IsNotNull(stats.Result);
Assert.IsTrue(stats.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetStatsRanked_CurrentSeason_Test()
{
var stats = summoner.GetStatsRanked();
Assert.IsNotNull(stats);
Assert.IsTrue(stats.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetStatsRankedAsync_CurrentSeason_Test()
{
var stats = summoner.GetStatsRankedAsync();
Assert.IsNotNull(stats.Result);
Assert.IsTrue(stats.Result.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner")]
public void GetTeams_Test()
{
var teams = summoner.GetTeams();
Assert.IsNotNull(teams);
Assert.IsTrue(teams.Count() > 0);
}
[TestMethod]
[TestCategory("Summoner"), TestCategory("Async")]
public void GetTeamsAsync_Test()
{
var teams = summoner.GetTeamsAsync();
Assert.IsNotNull(teams.Result);
Assert.IsTrue(teams.Result.Count() > 0);
}
}
}