Skip to content

Commit

Permalink
Added in missingtcgplayer prices
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymarvels committed Mar 3, 2023
1 parent 058d945 commit 6e1a383
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
23 changes: 23 additions & 0 deletions PokemonTcgSdk.Standard.Tests/PokemonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,5 +399,28 @@ public async Task GetPokemon_ApiResourcePageAsync_AncientTrait()
Assert.That(page.Page, Is.EqualTo("1").NoClip);
Assert.That(page.PageSize, Is.EqualTo("10").NoClip);
}

[Test]
public async Task GetPokemon_ApiResourcePageAsync_TcgPrices1stEdition()
{
// assemble
var httpclient = new HttpClient();
var pokeClient = new PokemonApiClient(httpclient);

var filter = PokemonFilterBuilder.CreatePokemonFilter().AddId("neo3-20");

// act
var page = await pokeClient.GetApiResourceAsync<PokemonCard>(10, 1, filter);

// assert
StringAssert.Contains("Lugia", page.Results.FirstOrDefault()?.Name);
StringAssert.Contains("Lugia", page.Results.LastOrDefault()?.Name);
Assert.That(page.Results.FirstOrDefault()?.Tcgplayer, Is.Not.Null);
Assert.That(page.Results.FirstOrDefault()?.Tcgplayer.Prices.The1StEdition, Is.Not.Null);
Assert.That(page.Results.FirstOrDefault()?.Tcgplayer.Prices.Unlimited, Is.Not.Null);

Assert.That(page.Page, Is.EqualTo("1").NoClip);
Assert.That(page.PageSize, Is.EqualTo("10").NoClip);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public class TcgPlayerPrices

[JsonProperty("unlimitedHolofoil", NullValueHandling = NullValueHandling.Ignore)]
public Prices UnlimitedHolofoil { get; set; }

[JsonProperty("1stEdition", NullValueHandling = NullValueHandling.Ignore)]
public Prices The1StEdition { get; set; }

[JsonProperty("unlimited", NullValueHandling = NullValueHandling.Ignore)]
public Prices Unlimited { get; set; }
}

public class Prices
Expand Down

0 comments on commit 6e1a383

Please sign in to comment.