Beispiel #1
0
        public void ProjectOntoPlane_ReturnsCorrectly()
        {
            //  arrange
            Vector3 sample = Vector3.forward + Vector3.up;

            //  act
            Vector3 resultF = PMath.ProjectOntoPlane(Vector3.up, sample);
            Vector3 resultU = PMath.ProjectOntoPlane(Vector3.forward, sample);
            Vector3 resultR = PMath.ProjectOntoPlane(Vector3.right, sample);

            //  assert
            Assert.AreEqual(Vector3.forward, resultF, "x projection failed" + TestHelper.ShowVariables(Vector3.forward, resultF));
            Assert.AreEqual(Vector3.up, resultU, "y projection failed" + TestHelper.ShowVariables(Vector3.up, resultU));
            Assert.AreEqual(sample, resultR, "z projection failed" + TestHelper.ShowVariables(sample, resultR));
        }