Merge branch 'main' of https://github.com/Serraniel/japanese-pokemon-cards-sdk-csharp into main
This commit is contained in:
commit
c69cd29add
23
JpnCardsPokemon.Tests/JpnCardsPokemon.Tests.csproj
Normal file
23
JpnCardsPokemon.Tests/JpnCardsPokemon.Tests.csproj
Normal 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>
|
23
JpnCardsPokemon.Tests/UnitTest1.cs
Normal file
23
JpnCardsPokemon.Tests/UnitTest1.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
JpnCardsPokemon.Tests/Usings.cs
Normal file
1
JpnCardsPokemon.Tests/Usings.cs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
global using NUnit.Framework;
|
|
@ -5,6 +5,8 @@ VisualStudioVersion = 17.5.33318.248
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JpnCardsPokemonSdk", "src\JpnCardsPokemonSdk.csproj", "{D5C0B825-C6F2-48BB-B4C8-E416B545151E}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JpnCardsPokemonSdk", "src\JpnCardsPokemonSdk.csproj", "{D5C0B825-C6F2-48BB-B4C8-E416B545151E}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JpnCardsPokemon.Tests", "JpnCardsPokemon.Tests\JpnCardsPokemon.Tests.csproj", "{13AA15F0-0CCD-4B59-A235-5DFB5C0B6C74}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
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}.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.ActiveCfg = Release|Any CPU
|
||||||
{D5C0B825-C6F2-48BB-B4C8-E416B545151E}.Release|Any CPU.Build.0 = 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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -5,6 +5,11 @@ namespace JpnCardsPokemonSdk.Api;
|
||||||
|
|
||||||
public class Set : EndpointObject
|
public class Set : EndpointObject
|
||||||
{
|
{
|
||||||
|
static Set()
|
||||||
|
{
|
||||||
|
EndpointFactory.RegisterTypeEndpoint<Set>(new SetEndpoint());
|
||||||
|
}
|
||||||
|
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class EnumerableApiResponse<T> : IApiResponse<IEnumerable<T>>,
|
||||||
(IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>)this).TotalCount / (
|
(IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>)this).TotalCount / (
|
||||||
(IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>)this).PageSize);
|
(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; }
|
ApiClient? IPageableApiResponse<EnumerableApiResponse<T>, IEnumerable<T>>.CurrentApiClient { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue