72 lines
2.9 KiB
C#
72 lines
2.9 KiB
C#
using System;
|
|
using NUnit.Framework;
|
|
using PkmnLibSharp.DynamicData;
|
|
using PkmnLibSharp.StaticData;
|
|
|
|
namespace PkmnLibRSharpTests.DynamicData
|
|
{
|
|
public class LearnedMoveTests
|
|
{
|
|
[Test]
|
|
public void LearnedMoveMoveData()
|
|
{
|
|
using var moveData = new MoveData("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
|
using var learnedMove = new LearnedMove(moveData, MoveLearnMethod.Level);
|
|
Assert.AreEqual("foo", learnedMove.MoveData.Name);
|
|
}
|
|
|
|
[Test]
|
|
public void LearnedMoveMaxPP()
|
|
{
|
|
using var moveData = new MoveData("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
|
using var learnedMove = new LearnedMove(moveData, MoveLearnMethod.Level);
|
|
Assert.AreEqual(30, learnedMove.MaxPP);
|
|
}
|
|
|
|
[Test]
|
|
public void LearnedMoveRemainingPP()
|
|
{
|
|
using var moveData = new MoveData("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
|
using var learnedMove = new LearnedMove(moveData, MoveLearnMethod.Level);
|
|
Assert.IsTrue(learnedMove.TryUse(1));
|
|
Assert.AreEqual(29, learnedMove.RemainingPP);
|
|
}
|
|
|
|
[Test]
|
|
public void LearnedMoveLearnMethod()
|
|
{
|
|
using var moveData = new MoveData("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
|
using var learnedMove = new LearnedMove(moveData, MoveLearnMethod.Level);
|
|
Assert.AreEqual(MoveLearnMethod.Level, learnedMove.LearnMethod);
|
|
}
|
|
|
|
[Test]
|
|
public void LearnedMoveRestoreAllUses()
|
|
{
|
|
using var moveData = new MoveData("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
|
using var learnedMove = new LearnedMove(moveData, MoveLearnMethod.Level);
|
|
Assert.IsTrue(learnedMove.TryUse(15));
|
|
Assert.AreEqual(15, learnedMove.RemainingPP);
|
|
learnedMove.RestoreAllUses();
|
|
Assert.AreEqual(30, learnedMove.RemainingPP);
|
|
}
|
|
|
|
[Test]
|
|
public void LearnedMoveRestoreUses()
|
|
{
|
|
using var moveData = new MoveData("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
|
using var learnedMove = new LearnedMove(moveData, MoveLearnMethod.Level);
|
|
Assert.IsTrue(learnedMove.TryUse(15));
|
|
Assert.AreEqual(15, learnedMove.RemainingPP);
|
|
learnedMove.RestoreUses(5);
|
|
Assert.AreEqual(20, learnedMove.RemainingPP);
|
|
}
|
|
|
|
}
|
|
} |