Files
MovementTests/tests/player/DashSystemUnitTest.cs
Minimata 5da2aa31ab
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 30s
Create tag and build when new code gets to main / Export (push) Successful in 5m10s
basic forge setup and refactored for some warning
2026-02-24 10:27:57 +01:00

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();
}
}