basic tests for a wider variety of files
This commit is contained in:
55
tests/player/DashSystemUnitTest.cs
Normal file
55
tests/player/DashSystemUnitTest.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user