-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
324a7be
commit fed5018
Showing
4 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using IGDB.Models; | ||
using RestEase; | ||
using Xunit; | ||
|
||
namespace IGDB.Tests | ||
{ | ||
public class Dumps | ||
{ | ||
IGDBClient _api; | ||
|
||
public Dumps() | ||
{ | ||
_api = new IGDB.IGDBClient( | ||
Environment.GetEnvironmentVariable("IGDB_CLIENT_ID"), | ||
Environment.GetEnvironmentVariable("IGDB_CLIENT_SECRET") | ||
); | ||
} | ||
|
||
[Fact] | ||
public async Task ShouldReturnDumpsList() | ||
{ | ||
var dumps = await _api.GetDataDumpsAsync(); | ||
|
||
Assert.NotNull(dumps); | ||
Assert.True(dumps.Length > 10); | ||
} | ||
|
||
[Fact] | ||
public async Task ShouldReturnGamesEndpointDump() | ||
{ | ||
var gameDump = await _api.GetDataDumpEndpointAsync("games"); | ||
|
||
Assert.NotNull(gameDump); | ||
Assert.NotNull(gameDump.S3Url); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
|
||
namespace IGDB.Models | ||
{ | ||
public class DataDump | ||
{ | ||
public string Endpoint { get; set; } | ||
public string FileName { get; set; } | ||
public DateTimeOffset UpdatedAt { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace IGDB.Models | ||
{ | ||
public class DataDumpEndpoint | ||
{ | ||
public string S3Url { get; set; } | ||
public string Endpoint { get; set; } | ||
public string FileName { get; set; } | ||
public long SizeBytes { get; set; } | ||
public DateTimeOffset UpdatedAt { get; set; } | ||
public string SchemaVersion { get; set; } | ||
|
||
/// <summary> | ||
/// Dictionary representing the schema of the CSV file. Tied to SchemaVersion. | ||
/// </summary> | ||
/// <remarks> | ||
/// Example: | ||
/// - id: "LONG" | ||
/// - name: "STRING" | ||
/// - created_at: "TIMESTAMP" | ||
/// - franchises: "LONG[]" | ||
/// - total_rating: "DOUBLE" | ||
/// - total_rating_count: "INTEGER" | ||
/// </remarks> | ||
public Dictionary<string, string> Schema { get; set; } | ||
} | ||
} |