2023-01-03 12:57:29 +00:00
|
|
|
using System;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using PkmnLibSharp.DynamicData;
|
|
|
|
using PkmnLibSharp.StaticData;
|
|
|
|
|
|
|
|
namespace PkmnLibRSharpTests.DynamicData
|
|
|
|
{
|
|
|
|
public class LearnedMoveTests
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void LearnedMoveMoveData()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
2023-01-03 12:57:29 +00:00
|
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
2023-06-25 14:30:12 +00:00
|
|
|
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
|
2023-01-03 12:57:29 +00:00
|
|
|
Assert.AreEqual("foo", learnedMove.MoveData.Name);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void LearnedMoveMaxPP()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
2023-01-03 12:57:29 +00:00
|
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
2023-06-25 14:30:12 +00:00
|
|
|
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
|
2023-01-03 12:57:29 +00:00
|
|
|
Assert.AreEqual(30, learnedMove.MaxPP);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void LearnedMoveRemainingPP()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
2023-01-03 12:57:29 +00:00
|
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
2023-06-25 14:30:12 +00:00
|
|
|
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
|
2023-01-03 12:57:29 +00:00
|
|
|
Assert.IsTrue(learnedMove.TryUse(1));
|
|
|
|
Assert.AreEqual(29, learnedMove.RemainingPP);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void LearnedMoveLearnMethod()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
2023-01-03 12:57:29 +00:00
|
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
2023-06-25 14:30:12 +00:00
|
|
|
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
|
2023-01-03 12:57:29 +00:00
|
|
|
Assert.AreEqual(MoveLearnMethod.Level, learnedMove.LearnMethod);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void LearnedMoveRestoreAllUses()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
2023-01-03 12:57:29 +00:00
|
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
2023-06-25 14:30:12 +00:00
|
|
|
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
|
2023-01-03 12:57:29 +00:00
|
|
|
Assert.IsTrue(learnedMove.TryUse(15));
|
|
|
|
Assert.AreEqual(15, learnedMove.RemainingPP);
|
|
|
|
learnedMove.RestoreAllUses();
|
|
|
|
Assert.AreEqual(30, learnedMove.RemainingPP);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void LearnedMoveRestoreUses()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
|
2023-01-03 12:57:29 +00:00
|
|
|
MoveTarget.All, 0, null, Array.Empty<string>());
|
2023-06-25 14:30:12 +00:00
|
|
|
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
|
2023-01-03 12:57:29 +00:00
|
|
|
Assert.IsTrue(learnedMove.TryUse(15));
|
|
|
|
Assert.AreEqual(15, learnedMove.RemainingPP);
|
|
|
|
learnedMove.RestoreUses(5);
|
|
|
|
Assert.AreEqual(20, learnedMove.RemainingPP);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|