back with more tests

This commit is contained in:
2026-02-22 17:25:45 +01:00
parent d37ae8d26c
commit a4873f183c
18 changed files with 605 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using Godot;
using GdUnit4;
using static GdUnit4.Assertions;
using Movementtests.interfaces;
using Movementtests.scenes.movement;
namespace Movementtests.tests;
[TestSuite, RequireGodotRuntime]
public class MovementSystemUnitTest
{
[TestCase]
public void GroundedMovementAcceleratesAndAppliesGravity()
{
var move = new CGroundedMovement();
move.RMovement = new RMovement(speed: 10.0f, acceleration: 1.0f, gravityModifier: 0.5f, targetHeight: 0.0f);
move.WallInFrontRayCast = new RayCast3D();
//move.GlobalPosition = Vector3.Zero;
var inputs = new MovementInputs(
Velocity: Vector3.Zero,
TargetLocation: new Vector3(10, 0, 0),
isOnFloor: false,
gravity: Vector3.Down * 9.8f,
delta: 1.0
);
var v = move.ComputeVelocity(inputs);
AssertVector(v).IsEqualApprox(new Vector3(10, -4.9f, 0), new Vector3(0.001f, 0.001f, 0.001f));
}
}