Files
RobustToolbox/Robust.UnitTesting/Shared/Maths/Ray_Test.cs
T
SilverandGitHub 25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00

26 lines
724 B
C#

using NUnit.Framework;
using Robust.Shared.Maths;
namespace Robust.UnitTesting.Shared.Maths
{
[TestFixture]
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
[TestOf(typeof(Ray))]
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, 1);
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));
}
}
}