using Chernobyl.Unity.Math; using FluentAssertions; using NUnit.Framework; using UnityEngine; using Array = System.Array; namespace Chernobyl.Unity.Test.Math { [TestFixture, Description("Tests for the code under Math.cs")] public class MathTests { #region Vector2IntExt.CalculateCenter(IEnumerable) [Test, Description("Ensures that Vector2IntExt.CalculateCenter(IEnumerable) " + "returns the correct point when given multiple points.")] public void CalculateCenterWithMultiplePoints() { var points = new[] {new Vector2Int(2, 6), new Vector2Int(5, 7), new Vector2Int(4, 8)}; points.CalculateCenter().Should().Be(new Vector2Int(4, 7)); } [Test, Description("Ensures that Vector2IntExt.CalculateCenter(IEnumerable) " + "returns the correct point when given no points.")] public void CalculateCenterWithNoPoints() { Array.Empty().CalculateCenter().Should().Be(new Vector2Int(0, 0)); } #endregion } }