66 lines
2.2 KiB
C#
66 lines
2.2 KiB
C#
using NUnit.Framework;
|
|
using PkmnLibSharp.Library;
|
|
using PkmnLibSharp.Library.Items;
|
|
|
|
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();
|
|
}
|
|
}
|
|
} |