From 6e1a383dfb1d34bbc47429733a1c3d72d4ed611d Mon Sep 17 00:00:00 2001 From: Jacob Spencer Date: Fri, 3 Mar 2023 16:57:16 +0000 Subject: [PATCH] Added in missingtcgplayer prices --- PokemonTcgSdk.Standard.Tests/PokemonTests.cs | 23 +++++++++++++++++++ .../HttpClients/Cards/Models/TcgPlayer.cs | 6 +++++ 2 files changed, 29 insertions(+) diff --git a/PokemonTcgSdk.Standard.Tests/PokemonTests.cs b/PokemonTcgSdk.Standard.Tests/PokemonTests.cs index 92c67d2..5946b62 100644 --- a/PokemonTcgSdk.Standard.Tests/PokemonTests.cs +++ b/PokemonTcgSdk.Standard.Tests/PokemonTests.cs @@ -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(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); + } } } \ No newline at end of file diff --git a/PokemonTcgSdk.Standard/Infrastructure/HttpClients/Cards/Models/TcgPlayer.cs b/PokemonTcgSdk.Standard/Infrastructure/HttpClients/Cards/Models/TcgPlayer.cs index 5aaf4c4..0da629b 100644 --- a/PokemonTcgSdk.Standard/Infrastructure/HttpClients/Cards/Models/TcgPlayer.cs +++ b/PokemonTcgSdk.Standard/Infrastructure/HttpClients/Cards/Models/TcgPlayer.cs @@ -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