PkmnLibRSharp/PkmnLibRSharpTests/StaticData/ItemTests.cs

31 lines
969 B
C#

using System;
using NUnit.Framework;
using PkmnLibSharp.StaticData;
namespace PkmnLibRSharpTests.StaticData
{
public class ItemTests
{
[Test]
public void BasicTests()
{
using var item = new Item("foobar", ItemCategory.Mail, BattleItemCategory.StatusHealing, 500,
Array.Empty<string>());
Assert.AreEqual("foobar", item.Name);
Assert.AreEqual(ItemCategory.Mail, item.Category);
Assert.AreEqual(BattleItemCategory.StatusHealing, item.BattleCategory);
Assert.AreEqual(500, item.Price);
}
[Test]
public void FlagTests()
{
using var item = new Item("foobar", ItemCategory.Mail, BattleItemCategory.StatusHealing, 500,
new []{"foo", "zet"});
Assert.That(item.HasFlag("foo"));
Assert.That(item.HasFlag("zet"));
Assert.That(!item.HasFlag("bar"));
}
}
}