Skip to content

Commit

Permalink
Reorganize WorldBosses tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sliekens committed Sep 16, 2023
1 parent a2bb5fb commit c4f3325
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 48 deletions.
40 changes: 40 additions & 0 deletions GW2SDK.Tests/Features/WorldBosses/DefeatedWorldBosses.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using GuildWars2.Tests.TestInfrastructure;
using Xunit;

namespace GuildWars2.Tests.Features.WorldBosses;

public class DefeatedWorldBosses
{
[Fact]
public async Task Can_be_listed()
{
var sut = Composer.Resolve<Gw2Client>();
var accessToken = Composer.Resolve<ApiKey>();

// Resets each day, not easy to prove it works
var actual = await sut.WorldBosses.GetDefeatedWorldBosses(accessToken.Key);

HashSet<string> expected = new()
{
"admiral_taidha_covington",
"claw_of_jormag",
"drakkar",
"fire_elemental",
"great_jungle_wurm",
"inquest_golem_mark_ii",
"karka_queen",
"megadestroyer",
"modniir_ulgoth",
"shadow_behemoth",
"svanir_shaman_chief",
"tequatl_the_sunless",
"the_shatterer",
"triple_trouble_wurm"
};

// The best we can do is verify that there are no unexpected bosses
Assert.Subset(expected, actual.Value);
}
}
48 changes: 0 additions & 48 deletions GW2SDK.Tests/Features/WorldBosses/WorldBossQueryTest.cs

This file was deleted.

20 changes: 20 additions & 0 deletions GW2SDK.Tests/Features/WorldBosses/WorldBosses.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.WorldBosses;

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

var actual = await sut.WorldBosses.GetWorldBosses();

Assert.NotEmpty(actual.Value);
Assert.Equal(actual.Value.Count, actual.ResultContext.ResultCount);
Assert.Equal(actual.Value.Count, actual.ResultContext.ResultTotal);
}
}

0 comments on commit c4f3325

Please sign in to comment.