PkmnLibRSharp/PkmnLibRSharpTests/DynamicData/LearnedMoveTests.cs

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()
{
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
MoveTarget.All, 0, null, Array.Empty<string>());
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
Assert.AreEqual("foo", learnedMove.MoveData.Name);
}
[Test]
public void LearnedMoveMaxPP()
{
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
MoveTarget.All, 0, null, Array.Empty<string>());
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
Assert.AreEqual(30, learnedMove.MaxPP);
}
[Test]
public void LearnedMoveRemainingPP()
{
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
MoveTarget.All, 0, null, Array.Empty<string>());
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
Assert.IsTrue(learnedMove.TryUse(1));
Assert.AreEqual(29, learnedMove.RemainingPP);
}
[Test]
public void LearnedMoveLearnMethod()
{
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
MoveTarget.All, 0, null, Array.Empty<string>());
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
Assert.AreEqual(MoveLearnMethod.Level, learnedMove.LearnMethod);
}
[Test]
public void LearnedMoveRestoreAllUses()
{
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
MoveTarget.All, 0, null, Array.Empty<string>());
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
Assert.IsTrue(learnedMove.TryUse(15));
Assert.AreEqual(15, learnedMove.RemainingPP);
learnedMove.RestoreAllUses();
Assert.AreEqual(30, learnedMove.RemainingPP);
}
[Test]
public void LearnedMoveRestoreUses()
{
var moveData = MoveData.Create("foo", new TypeIdentifier(0), MoveCategory.Physical, 100, 20, 30,
MoveTarget.All, 0, null, Array.Empty<string>());
var learnedMove = LearnedMove.Create(moveData, MoveLearnMethod.Level);
Assert.IsTrue(learnedMove.TryUse(15));
Assert.AreEqual(15, learnedMove.RemainingPP);
learnedMove.RestoreUses(5);
Assert.AreEqual(20, learnedMove.RemainingPP);
}
}
}