Files
RobustToolbox/Robust.UnitTesting/Client/Graphics/EyeTest.cs
T
AcruidandGitHub a947a38f3c View Rotation (#1016)
* Adds a derived class from Nunit's Is test constraint class.
The game camera can now be rotated.

* Added the new `bind` command to the console, used to bind a key to a keybind.
Added two new keybinds for rotating the View camera left and right.
Added more info to the ""Component does not exist for state" exception.
Added Reduced() and FlipPositive() public functions to Angle.

* Fix a copy/paste bug.

* Adds missing code to bind/unbind CameraRotateLeft.
Camera snapping now actually uses the CameraSnapTolerance constant.
2020-03-25 02:22:18 +01:00

37 lines
873 B
C#

using NUnit.Framework;
using Robust.Client.Graphics.ClientEye;
using Robust.Shared.Map;
using Robust.Shared.Maths;
// ReSharper disable AccessToStaticMemberViaDerivedType
namespace Robust.UnitTesting.Client.Graphics
{
[TestFixture, Parallelizable, TestOf(typeof(Eye))]
class EyeTest
{
[Test]
public void Constructor_DefaultZoom_isOne()
{
var eye = new Eye();
Assert.That(eye.Zoom, Is.Approximately(Vector2.One));
}
[Test]
public void Constructor_DefaultPosition_isZero()
{
var eye = new Eye();
Assert.That(eye.Position, Is.EqualTo(MapCoordinates.Nullspace));
}
[Test]
public void Constructor_DefaultDrawFov_isTrue()
{
var eye = new Eye();
Assert.That(eye.DrawFov, Is.True);
}
}
}