Beispiel #1
0
        public void AnswerCorrectUpdatePath()
        {
            Vector3 _finishPos = Field.FinishPointPos();

            CreatePathForPlane(plane.Position, _finishPos, _finishPos);
            plane.Accelerate();
            pathPlane.Path.TriggerPathUpdate();
        }
Beispiel #2
0
        private static void TestPlane()
        {
            Motor motor = new Motor(VehicleLib.Enums.Fuel.petrol, 650);
            Plane plane = new Plane(motor);

            Console.WriteLine("Plane:");
            plane.Start();
            plane.Accelerate(20);
            Console.WriteLine(plane.ToString());
            plane.TakeOff();
            plane.Stop();
            Console.WriteLine(plane.ToString());

            plane.Accelerate(100);
            plane.Decelerate(20);
            plane.Land();
            plane.Stop();
        }
Beispiel #3
0
        public void Decelerate_DoesNotCauseNegativeSpeed()
        {
            string manufacturer = "Manufacturer Test";
            string model        = "Model Test";

            Plane plane = new Plane(manufacturer, model);


            plane.Accelerate();
            plane.Accelerate();

            plane.Decelerate();
            plane.Decelerate();
            plane.Decelerate();

            double finalSpeed = plane.Speed;


            Assert.GreaterOrEqual(finalSpeed, 0);
        }
Beispiel #4
0
        public void Decelerate_DecreasesSpeed()
        {
            string manufacturer = "Manufacturer Test";
            string model        = "Model Test";

            Plane plane = new Plane(manufacturer, model);


            plane.Accelerate();
            plane.Accelerate();


            double initialSpeed = plane.Speed;

            plane.Decelerate();

            double finalSpeed = plane.Speed;


            Assert.Less(finalSpeed, initialSpeed);
        }