56 lines
1.6 KiB
C#
56 lines
1.6 KiB
C#
using Godot;
|
|
using GdUnit4;
|
|
using static GdUnit4.Assertions;
|
|
using Movementtests.systems;
|
|
|
|
namespace Movementtests.tests;
|
|
|
|
[TestSuite, RequireGodotRuntime]
|
|
public class DashSystemUnitTest
|
|
{
|
|
private DashSystem _dashSystem;
|
|
|
|
[BeforeTest]
|
|
public void SetupTest()
|
|
{
|
|
_dashSystem = new DashSystem();
|
|
|
|
_dashSystem.DashCast3D = new ShapeCast3D();
|
|
_dashSystem.AddChild(_dashSystem.DashCast3D);
|
|
|
|
_dashSystem.DashCastDrop = new ShapeCast3D();
|
|
_dashSystem.AddChild(_dashSystem.DashCastDrop);
|
|
|
|
_dashSystem.DashTarget = new MeshInstance3D();
|
|
_dashSystem.AddChild(_dashSystem.DashTarget);
|
|
|
|
_dashSystem.DashDropIndicator = new MeshInstance3D();
|
|
_dashSystem.AddChild(_dashSystem.DashDropIndicator);
|
|
|
|
_dashSystem.DashDropLocationIndicator = new MeshInstance3D();
|
|
_dashSystem.AddChild(_dashSystem.DashDropLocationIndicator);
|
|
}
|
|
|
|
[AfterTest]
|
|
public void CleanupTest()
|
|
{
|
|
_dashSystem?.Free();
|
|
}
|
|
|
|
[TestCase]
|
|
public void TestStopPreparingDash()
|
|
{
|
|
_dashSystem.CanDashThroughTarget = true;
|
|
_dashSystem.DashTarget.Visible = true;
|
|
_dashSystem.DashDropIndicator.Visible = true;
|
|
_dashSystem.DashDropLocationIndicator.Visible = true;
|
|
|
|
_dashSystem.StopPreparingDash();
|
|
|
|
AssertBool(_dashSystem.CanDashThroughTarget).IsFalse();
|
|
AssertBool(_dashSystem.DashTarget.Visible).IsFalse();
|
|
AssertBool(_dashSystem.DashDropIndicator.Visible).IsFalse();
|
|
AssertBool(_dashSystem.DashDropLocationIndicator.Visible).IsFalse();
|
|
}
|
|
}
|