<filename>Service/Greenlands.Api.Test/Evalutators/MatchedPlayerPositionDistanceTest.csusing NUnit.Framework;
using Greenlands.Api.Evaluators;
using Greenlands.Api.Events.v1.Helpers;

namespace Greenlands.Api.Test.Evaluators;

public class MatchedPlayerPositionDistanceTests
{
    [SetUp]
    public void Setup()
    {
    }

    [Test]
    public void GivenTwoIdenticalLocationsDistanceShouldBe0()
    {
        // Arrange
        var l1 = new Location(0, 0, 0, 0, 0);
        var l2 = new Location(0, 0, 0, 0, 0);
        var expectedDistance = 0;

        // Act
        var distance = MatchedPlayerLocationEvaluator.GetDistance(l1, l2);

        // Assert
        Assert.AreEqual(expectedDistance, distance);
    }

    [Test]
    public void GivenTwoLocations1DistanceApartShouldBe1()
    {
        // Arrange
        var l1 = new Location(0, 0, 0, 0, 0);
        var l2 = new Location(0, 0, 1, 0, 0);
        var expectedDistance = 1;

        // Act
        var distance = MatchedPlayerLocationEvaluator.GetDistance(l1, l2);

        // Assert
        Assert.AreEqual(expectedDistance, distance);
    }
}
