|
6 | 6 |
|
7 | 7 | namespace IGDB.Tests |
8 | 8 | { |
| 9 | + [Collection("/popularity_types")] |
9 | 10 | public class PopScore |
10 | | - { |
11 | | - IGDBClient _api; |
| 11 | + { |
| 12 | + IGDBClient _api; |
12 | 13 |
|
13 | | - public PopScore() |
14 | | - { |
15 | | - _api = new IGDB.IGDBClient( |
16 | | - Environment.GetEnvironmentVariable("IGDB_CLIENT_ID"), |
17 | | - Environment.GetEnvironmentVariable("IGDB_CLIENT_SECRET") |
18 | | - ); |
19 | | - } |
| 14 | + public PopScore() |
| 15 | + { |
| 16 | + _api = IGDBClient.CreateWithDefaults( |
| 17 | + Environment.GetEnvironmentVariable("IGDB_CLIENT_ID"), |
| 18 | + Environment.GetEnvironmentVariable("IGDB_CLIENT_SECRET") |
| 19 | + ); |
| 20 | + } |
20 | 21 |
|
21 | | - [Fact] |
22 | | - public async Task ShouldReturnAllPopularityTypes() |
23 | | - { |
24 | | - var popularityTypes = await _api.QueryAsync<PopularityType>(IGDBClient.Endpoints.PopularityTypes, "fields *;"); |
| 22 | + [Fact] |
| 23 | + public async Task ShouldReturnAllPopularityTypes() |
| 24 | + { |
| 25 | + var popularityTypes = await _api.QueryAsync<PopularityType>(IGDBClient.Endpoints.PopularityTypes, "fields *;"); |
25 | 26 |
|
26 | | - Assert.NotNull(popularityTypes); |
27 | | - foreach (var popularityType in popularityTypes) |
28 | | - { |
29 | | - Assert.NotNull(popularityType.Checksum); |
30 | | - Assert.NotNull(popularityType.CreatedAt); |
31 | | - Assert.NotNull(popularityType.Name); |
32 | | - Assert.NotNull(popularityType.PopularitySource); |
33 | | - Assert.NotNull(popularityType.UpdatedAt); |
34 | | - } |
35 | | - } |
| 27 | + Assert.NotNull(popularityTypes); |
| 28 | + foreach (var popularityType in popularityTypes) |
| 29 | + { |
| 30 | + Assert.NotNull(popularityType.Checksum); |
| 31 | + Assert.NotNull(popularityType.CreatedAt); |
| 32 | + Assert.NotNull(popularityType.Name); |
| 33 | + Assert.NotNull(popularityType.ExternalPopularitySource.Id); |
| 34 | + Assert.NotNull(popularityType.UpdatedAt); |
| 35 | + } |
| 36 | + } |
36 | 37 |
|
37 | | - [Fact] |
38 | | - public async Task ShouldReturnLimitedPopularityPrimitives() |
39 | | - { |
40 | | - var popularityPrimitives = await _api.QueryAsync<PopularityPrimitive>( |
41 | | - IGDBClient.Endpoints.PopularityPrimitives, |
42 | | - "fields *; limit 10;"); |
| 38 | + [Fact] |
| 39 | + public async Task ShouldReturnLimitedPopularityPrimitives() |
| 40 | + { |
| 41 | + var popularityPrimitives = await _api.QueryAsync<PopularityPrimitive>( |
| 42 | + IGDBClient.Endpoints.PopularityPrimitives, |
| 43 | + "fields *; limit 10;"); |
43 | 44 |
|
44 | | - Assert.NotNull(popularityPrimitives); |
45 | | - Assert.True(popularityPrimitives.Length == 10); |
| 45 | + Assert.NotNull(popularityPrimitives); |
| 46 | + Assert.True(popularityPrimitives.Length == 10); |
46 | 47 |
|
47 | | - foreach (var popularityPrimitive in popularityPrimitives) |
48 | | - { |
49 | | - Assert.NotNull(popularityPrimitive.CalculatedAt); |
50 | | - //Assert.NotNull(popularityPrimitive.Checksum); |
51 | | - Assert.NotNull(popularityPrimitive.CreatedAt); |
52 | | - Assert.NotNull(popularityPrimitive.PopularitySource); |
53 | | - Assert.NotNull(popularityPrimitive.PopularityType); |
54 | | - Assert.NotNull(popularityPrimitive.UpdatedAt); |
55 | | - Assert.NotNull(popularityPrimitive.Value); |
56 | | - } |
57 | | - } |
58 | | - } |
| 48 | + foreach (var popularityPrimitive in popularityPrimitives) |
| 49 | + { |
| 50 | + Assert.NotNull(popularityPrimitive.CalculatedAt); |
| 51 | + Assert.NotNull(popularityPrimitive.CreatedAt); |
| 52 | + Assert.NotNull(popularityPrimitive.ExternalPopularitySource.Id); |
| 53 | + Assert.NotNull(popularityPrimitive.PopularityType); |
| 54 | + Assert.NotNull(popularityPrimitive.UpdatedAt); |
| 55 | + Assert.NotNull(popularityPrimitive.Value); |
| 56 | + } |
| 57 | + } |
| 58 | + } |
59 | 59 | } |
0 commit comments