Files
MovementTests/tests/player/DashSystemUnitTest.cs
Minimata 9207295a99
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Test (push) Failing after 7m29s
Create tag and build when new code gets to main / Export (push) Successful in 8m18s
basic tests for a wider variety of files
2026-02-20 16:58:17 +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();
}
}