Files
PJB3005 788e9386fd Split up test project
Robust.UnitTesting was both ALL tests for RT, and also API surface for content tests.

Tests are now split into separate projects as appropriate, and the API side has also been split off.
2025-12-16 01:36:53 +01:00

27 lines
756 B
C#

using System.Numerics;
using NUnit.Framework;
using Robust.Shared.Physics;
namespace Robust.Shared.Maths.Tests
{
[TestFixture]
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
[TestOf(typeof(Ray))]
internal sealed class Ray_Test
{
[Test]
public void RayIntersectsBoxTest()
{
var box = new Box2(new Vector2(5, 5), new Vector2(10, -5));
var ray = new Ray(new Vector2(0, 1), Vector2.UnitX);
var result = ray.Intersects(box, out var dist, out var hitPos);
Assert.That(result, Is.True);
Assert.That(dist, Is.EqualTo(5));
Assert.That(hitPos.X, Is.EqualTo(5));
Assert.That(hitPos.Y, Is.EqualTo(1));
}
}
}