This commit is contained in:
Serraniel 2023-02-28 12:50:53 +01:00
commit c69cd29add
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3
6 changed files with 59 additions and 1 deletions

View file

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\JpnCardsPokemonSdk.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,23 @@
using JpnCardsPokemonSdk.Api;
using JpnCardsPokemonSdk.Client;
namespace JpnCardsPokemon.Tests
{
public class Tests
{
private ApiClient Client = new ApiClient();
[SetUp]
public void Setup()
{
}
[Test]
public async Task TestFetchSets()
{
var sets = await Client.FetchDataAsync<Set>();
Assert.IsNotEmpty(sets?.Data);
// Assert.Pass();
}
}
}

View file

@ -0,0 +1 @@
global using NUnit.Framework;

View file

@ -5,6 +5,8 @@ VisualStudioVersion = 17.5.33318.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JpnCardsPokemonSdk", "src\JpnCardsPokemonSdk.csproj", "{D5C0B825-C6F2-48BB-B4C8-E416B545151E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JpnCardsPokemon.Tests", "JpnCardsPokemon.Tests\JpnCardsPokemon.Tests.csproj", "{13AA15F0-0CCD-4B59-A235-5DFB5C0B6C74}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -15,6 +17,10 @@ Global
{D5C0B825-C6F2-48BB-B4C8-E416B545151E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5C0B825-C6F2-48BB-B4C8-E416B545151E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5C0B825-C6F2-48BB-B4C8-E416B545151E}.Release|Any CPU.Build.0 = Release|Any CPU
{13AA15F0-0CCD-4B59-A235-5DFB5C0B6C74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13AA15F0-0CCD-4B59-A235-5DFB5C0B6C74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13AA15F0-0CCD-4B59-A235-5DFB5C0B6C74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13AA15F0-0CCD-4B59-A235-5DFB5C0B6C74}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -5,6 +5,11 @@ namespace JpnCardsPokemonSdk.Api;
public class Set : EndpointObject
{
static Set()
{
EndpointFactory.RegisterTypeEndpoint<Set>(new SetEndpoint());
}
public string? Name { get; set; }
public int Id { get; set; }

View file

@ -15,7 +15,7 @@ public class EnumerableApiResponse<T> : IApiResponse<IEnumerable<T>>,
(IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>)this).TotalCount / (
(IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>)this).PageSize);
IEnumerable<T>? IApiResponse<IEnumerable<T>>.Data { get; set; }
public IEnumerable<T>? Data { get; set; }
ApiClient? IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.CurrentApiClient { get; set; }