-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Threading.Tasks; | ||
using GuildWars2.Tests.TestInfrastructure; | ||
using Xunit; | ||
|
||
namespace GuildWars2.Tests.Features.Inventories; | ||
|
||
public class Inventory | ||
{ | ||
[Fact] | ||
public async Task Can_be_found_by_character_name() | ||
{ | ||
var sut = Composer.Resolve<Gw2Client>(); | ||
var character = Composer.Resolve<TestCharacter>(); | ||
var accessToken = Composer.Resolve<ApiKey>(); | ||
|
||
var actual = await sut.Inventory.GetInventory(character.Name, accessToken.Key); | ||
|
||
Assert.NotNull(actual.Value); | ||
Assert.NotEmpty(actual.Value.Bags); | ||
Assert.All( | ||
actual.Value.Bags, | ||
bag => | ||
{ | ||
if (bag is not null) | ||
{ | ||
Assert.True(bag.Id > 0); | ||
Assert.True(bag.Size > 0); | ||
Assert.Equal(bag.Size, bag.Inventory.Count); | ||
Assert.All( | ||
bag.Inventory, | ||
slot => | ||
{ | ||
if (slot is not null) | ||
{ | ||
Assert.True(slot.Id > 0); | ||
Assert.True(slot.Count > 0); | ||
} | ||
} | ||
); | ||
} | ||
} | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Threading.Tasks; | ||
using GuildWars2.Tests.TestInfrastructure; | ||
using Xunit; | ||
|
||
namespace GuildWars2.Tests.Features.Inventories; | ||
|
||
public class SharedInventory | ||
{ | ||
[Fact] | ||
public async Task Can_be_listed() | ||
{ | ||
var sut = Composer.Resolve<Gw2Client>(); | ||
var accessToken = Composer.Resolve<ApiKey>(); | ||
|
||
var actual = await sut.Inventory.GetSharedInventory(accessToken.Key); | ||
|
||
Assert.NotEmpty(actual.Value); | ||
Assert.All( | ||
actual.Value, | ||
slot => | ||
{ | ||
if (slot is not null) | ||
{ | ||
Assert.True(slot.Id > 0); | ||
Assert.True(slot.Count > 0); | ||
} | ||
} | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.