PkmnLibSharp/PkmnLibSharpTests/Battling/BattleTests/BasicBattleTests.cs

45 lines
1.6 KiB
C#

using NUnit.Framework;
using PkmnLibSharp.Battling;
namespace PkmnLibSharpTests.Battling.BattleTests
{
public class BasicBattleTests
{
[Test]
public void InitializeBattle()
{
var lib = BattleLibraryHelper.GetLibrary();
var battle = new BattleBuilder(lib, true, 2, 1).Build();
Assert.AreEqual(lib, battle.Library);
Assert.AreEqual(true, battle.CanFlee);
Assert.AreEqual(2, battle.SidesCount);
Assert.AreEqual(false, battle.HasEnded);
Assert.AreEqual(0, battle.PartiesCount);
battle.Dispose();
}
private static PokemonParty BuildTestParty(BattleLibrary lib)
{
var party = new PokemonParty();
party.SwapInto(0, new PokemonBuilder(lib, "testSpecies", 50).Build());
return party;
}
[Test]
public void InitializeBattleWithParties()
{
var lib = BattleLibraryHelper.GetLibrary();
var battle =
new BattleBuilder(lib, true, 2, 1)
.WithPartyOnPositions(BuildTestParty(lib), new BattlePosition(0, 0))
.WithPartyOnPositions(BuildTestParty(lib), new BattlePosition(1, 0))
.Build();
Assert.AreEqual(lib, battle.Library);
Assert.AreEqual(true, battle.CanFlee);
Assert.AreEqual(2, battle.SidesCount);
Assert.AreEqual(false, battle.HasEnded);
Assert.AreEqual(2, battle.PartiesCount);
battle.Dispose();
}
}
}