Skip to content

Commit

Permalink
Reorganize Skins tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sliekens committed Sep 16, 2023
1 parent 19799b6 commit 790c7e8
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 66 deletions.
20 changes: 20 additions & 0 deletions GW2SDK.Tests/Features/Skins/SkinById.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Threading.Tasks;
using GuildWars2.Tests.TestInfrastructure;
using Xunit;

namespace GuildWars2.Tests.Features.Skins;

public class SkinById
{
[Fact]
public async Task Can_be_found()
{
var sut = Composer.Resolve<Gw2Client>();

const int id = 1;

var actual = await sut.Wardrobe.GetSkinById(id);

Assert.Equal(id, actual.Value.Id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace GuildWars2.Tests.Features.Skins;

public class SkinJsonTest : IClassFixture<SkinFixture>
public class SkinJson : IClassFixture<SkinFixture>
{
public SkinJsonTest(SkinFixture fixture)
public SkinJson(SkinFixture fixture)
{
this.fixture = fixture;
}
Expand Down
31 changes: 31 additions & 0 deletions GW2SDK.Tests/Features/Skins/SkinsByFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using GuildWars2.Tests.TestInfrastructure;
using Xunit;

namespace GuildWars2.Tests.Features.Skins;

public class SkinsByFilter
{
[Fact]
public async Task Can_be_filtered_by_id()
{
var sut = Composer.Resolve<Gw2Client>();

HashSet<int> ids = new()
{
1,
2,
3
};

var actual = await sut.Wardrobe.GetSkinsByIds(ids);

Assert.Collection(
ids,
first => Assert.Contains(actual.Value, found => found.Id == first),
second => Assert.Contains(actual.Value, found => found.Id == second),
third => Assert.Contains(actual.Value, found => found.Id == third)
);
}
}
19 changes: 19 additions & 0 deletions GW2SDK.Tests/Features/Skins/SkinsByPage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Threading.Tasks;
using GuildWars2.Tests.TestInfrastructure;
using Xunit;

namespace GuildWars2.Tests.Features.Skins;

public class SkinsByPage
{
[Fact]
public async Task Can_be_filtered_by_page()
{
var sut = Composer.Resolve<Gw2Client>();

var actual = await sut.Wardrobe.GetSkinsByPage(0, 3);

Assert.Equal(3, actual.Value.Count);
Assert.Equal(3, actual.PageContext.PageSize);
}
}
18 changes: 18 additions & 0 deletions GW2SDK.Tests/Features/Skins/SkinsIndex.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Threading.Tasks;
using GuildWars2.Tests.TestInfrastructure;
using Xunit;

namespace GuildWars2.Tests.Features.Skins;

public class SkinsIndex
{
[Fact]
public async Task Is_not_empty()
{
var sut = Composer.Resolve<Gw2Client>();

var actual = await sut.Wardrobe.GetSkinsIndex();

Assert.Equal(actual.ResultContext.ResultTotal, actual.Value.Count);
}
}
64 changes: 0 additions & 64 deletions GW2SDK.Tests/Features/Skins/WardrobeQueryTest.cs

This file was deleted.

0 comments on commit 790c7e8

Please sign in to comment.