Skip to content

Commit

Permalink
test(factory)
Browse files Browse the repository at this point in the history
add tests for skadi inventory factory
  • Loading branch information
igeligel committed Jul 25, 2016
1 parent effb47b commit 6f1f156
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/skadisteam.inventory.test/Factories/SkadiInventoryTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Newtonsoft.Json;
using skadisteam.inventory.Factories;
using skadisteam.inventory.Models.Json;
using skadisteam.inventory.test.Constants;
using Xunit;

namespace skadisteam.inventory.test.Factories
{
public class SkadiInventoryTest
{
[Fact]
public void CsGoInventoryCountOne()
{
var rootInventory = JsonConvert.DeserializeObject<RootInventory>(Inventories.CsGoOne);
var skadiInventory = SkadiInventoryFactory.Create(rootInventory);
Assert.Equal(4, skadiInventory.Items.Count);
}

[Fact]
public void CsGoInventoryCountTwo()
{
var rootInventory = JsonConvert.DeserializeObject<RootInventory>(Inventories.CsGoTwo);
var skadiInventory = SkadiInventoryFactory.Create(rootInventory);
Assert.Equal(753, skadiInventory.Items.Count);
}

[Fact]
public void CsGoInventoryCountThree()
{
var rootInventory = JsonConvert.DeserializeObject<RootInventory>(Inventories.CsGoThree);
var skadiInventory = SkadiInventoryFactory.Create(rootInventory);
Assert.Equal(24, skadiInventory.Items.Count);
}

[Fact]
public void SteamInventoryCountOne()
{
var rootInventory = JsonConvert.DeserializeObject<RootInventory>(Inventories.SteamOne);
var skadiInventory = SkadiInventoryFactory.Create(rootInventory);
Assert.Equal(58, skadiInventory.Items.Count);
}

[Fact]
public void TeamFortressInventoryCountOne()
{
var rootInventory = JsonConvert.DeserializeObject<RootInventory>(Inventories.TeamFortressOne);
var skadiInventory = SkadiInventoryFactory.Create(rootInventory);
Assert.Equal(85, skadiInventory.Items.Count);
}
}
}

0 comments on commit 6f1f156

Please sign in to comment.