Example #1
0
    public void GetDistances_Test()
    {
        // setup positions
        Vector3[] positions = new Vector3[]
        {
            new Vector3(0f, 0f, 0f),
            new Vector3(1f, 0f, 0f),
            new Vector3(0f, 1f, 0f),
            new Vector3(0f, 0f, 1f),
            new Vector3(-1f, 0f, 0f),
            new Vector3(0f, -1f, 0f),
            new Vector3(0f, 0f, -1f),
            new Vector3(0f, 2f, 0f),
            new Vector3(1f, 1f, 1f),
            new Vector3(0f, 0f, 100f)
        };

        // setup expected distances
        float[] expected = new float[]
        {
            0f, 1f, 1f, 1f, 1f, 1f, 1f, 2f, 1.732f, 100f
        };

        // perform
        float[] distances = tracer.GetDistances(positions);

        // assert
        Assert.AreEqual(expected, distances);
    }