Skip to content

Commit

Permalink
fix: support for ExpandedGames
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranayub committed May 30, 2024
1 parent b92deec commit 571e8cd
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions IGDB.Tests/Games.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,69 @@ public async Task ShouldReturnResponseWithUnixTimestamp()
Assert.NotNull(game.CreatedAt);
Assert.True(game.CreatedAt.Value.Year > 1970);
}

[Fact]
public async Task ShouldReturnGameWithPortsBundlesRemastersAndExpandedGames()
{
var games = await _api.QueryAsync<Game>(IGDBClient.Endpoints.Games, "fields id,ports,bundles,remasters,expanded_games; where id = 358;");

Assert.NotNull(games);

var game = games[0];

Assert.NotEmpty(game.Ports.Ids);
Assert.NotEmpty(game.Bundles.Ids);
Assert.NotEmpty(game.Remasters.Ids);
Assert.NotEmpty(game.ExpandedGames.Ids);
}

[Fact]
public async Task ShouldReturnGameWithRemakes()
{
var games = await _api.QueryAsync<Game>(IGDBClient.Endpoints.Games, "fields id,remakes; where id = 974;");

Assert.NotNull(games);

var game = games[0];

Assert.NotEmpty(game.Remakes.Ids);
}

[Fact]
public async Task ShouldReturnGameWithExpansions()
{
var games = await _api.QueryAsync<Game>(IGDBClient.Endpoints.Games, "fields id,expansions; where id = 1939;");

Assert.NotNull(games);

var game = games[0];

Assert.NotEmpty(game.Expansions.Ids);
}

[Fact]
public async Task ShouldReturnGameWithStandaloneExpansions()
{
var games = await _api.QueryAsync<Game>(IGDBClient.Endpoints.Games, "fields id,standalone_expansions; where id = 14813;");

Assert.NotNull(games);

var game = games[0];

Assert.NotEmpty(game.StandaloneExpansions.Ids);
}

[Fact]
public async Task ShouldReturnGameWithDlc()
{
var games = await _api.QueryAsync<Game>(IGDBClient.Endpoints.Games, "fields id,dlcs; where id = 18968;");

Assert.NotNull(games);

var game = games[0];

Assert.NotEmpty(game.Dlcs.Ids);
}

[Fact]
public async Task ShouldReturnGameCount()
Expand Down
2 changes: 1 addition & 1 deletion IGDB/Models/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Game : ITimestamps, IIdentifier, IHasChecksum

public IdentitiesOrValues<Game> Dlcs { get; set; }

public IdentitiesOrValues<Game> Expandedgames { get; set; }
public IdentitiesOrValues<Game> ExpandedGames { get; set; }

public IdentitiesOrValues<Game> Expansions { get; set; }

Expand Down

0 comments on commit 571e8cd

Please sign in to comment.