Update to latest pkmnlib, adds LearnedMove wrapper
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
72
PkmnLibRSharpTests/DynamicData/LearnedMoveTests.cs
Normal file
72
PkmnLibRSharpTests/DynamicData/LearnedMoveTests.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user