Exemple #1
0
        public void DisplacementCalculation_NegativeVelocity_CrossOverAtMinPosition_ExpectVelocityAdjustment2()
        {
            float NewPosition             = 95F;
            float MinPlayerCoordinate     = 100F;
            float MaxPlayerCoordinate     = 200F;
            float Velocity                = -5.5F;
            float expectedMapDisplacement = -0.5F;

            var calculatedMapDisplacement = MapCalculations.GetMapDisplacement(
                NewPosition,
                MinPlayerCoordinate,
                MaxPlayerCoordinate,
                Velocity);

            Assert.AreEqual(expectedMapDisplacement, calculatedMapDisplacement);
        }
Exemple #2
0
        public void DisplacementCalculation_NegativeVelocity_AboveMaxPosition_ExpectNoVelocity1()
        {
            float NewPosition             = 200F;
            float MinPlayerCoordinate     = 100F;
            float MaxPlayerCoordinate     = 200F;
            float Velocity                = -10F;
            float expectedMapDisplacement = 0F;

            var calculatedMapDisplacement = MapCalculations.GetMapDisplacement(
                NewPosition,
                MinPlayerCoordinate,
                MaxPlayerCoordinate,
                Velocity);

            Assert.AreEqual(expectedMapDisplacement, calculatedMapDisplacement);
        }