using System;
using UnityEngine;
using NUnit.Framework;
namespace Framework.Geometry.Lines {
/// Unit tests for the 2D line class
[TestFixture]
internal static class Line2Test {
///
/// Verifies that the scalar value constructor assigns the line's coordinates
///
[Test]
public static void IndividualConstructorAssignsValues() {
var segment = new Line2(1.2f, 3.4f, 5.6f, 7.8f);
Assert.That(segment.Offset.x, Is.EqualTo(1.2f));
Assert.That(segment.Offset.y, Is.EqualTo(3.4f));
Assert.That(segment.Direction.x, Is.EqualTo(5.6f));
Assert.That(segment.Direction.y, Is.EqualTo(7.8f));
}
///
/// Verifies that the scalar value constructor assigns the line's coordinates
///
[Test]
public static void VectorConstructorAssignsValues() {
var offset = new Vector2(1.2f, 3.4f);
var direction = new Vector2(5.6f, 7.8f);
var segment = new Line2(offset, direction);
Assert.That(segment.Offset.x, Is.EqualTo(offset.x));
Assert.That(segment.Offset.y, Is.EqualTo(offset.y));
Assert.That(segment.Direction.x, Is.EqualTo(direction.x));
Assert.That(segment.Direction.y, Is.EqualTo(direction.y));
}
}
} // namespace Framework.Geometry.Lines