PkmnLibSharp/PkmnLibSharpTests/Library/ItemTests.cs

66 lines
2.2 KiB
C#
Raw Normal View History

2020-05-05 18:46:17 +00:00
using NUnit.Framework;
using PkmnLibSharp.Library;
using PkmnLibSharp.Library.Items;
2020-05-05 18:46:17 +00:00
namespace PkmnLibSharpTests.Library
{
public class ItemTests
{
[Test]
public void ConstructDestruct()
{
var item = Item.Create("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
new[] {"testFlag"}, 50);
item.Dispose();
}
[Test]
public void GetName()
{
var item = Item.Create("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
new[] {"testFlag"}, 50);
Assert.AreEqual("foobar", item.Name);
item.Dispose();
}
[Test]
public void GetCategory()
{
var item = Item.Create("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
new[] {"testFlag"}, 50);
Assert.AreEqual(ItemCategory.MiscItem, item.Category);
item.Dispose();
}
[Test]
public void GetBattleCategory()
{
var item = Item.Create("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
new[] {"testFlag"}, 50);
Assert.AreEqual(BattleItemCategory.Healing, item.BattleCategory);
item.Dispose();
}
[Test]
public void GetPrice()
{
var item = Item.Create("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
new[] {"testFlag"}, 50);
Assert.AreEqual(1000, item.Price);
item.Dispose();
}
[Test]
public void HasFlag()
{
var item = Item.Create("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
new[] {"testFlag"}, 50);
Assert.True(item.HasFlag("testFlag"));
Assert.False(item.HasFlag("non-existing"));
item.Dispose();
}
[Test]
public void GetFlingPower()
{
var item = Item.Create("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
new[] {"testFlag"}, 50);
Assert.AreEqual(50, item.FlingPower);
item.Dispose();
}
}
}