Beispiel #1
0
        private void LoadPlanes()
        {
            // Array of front-end PictureBoxes
            PictureBox[] pbxPlanes = { pbxPlane1, pbxPlane2, pbxPlane3, pbxPlane4 };

            // Instantiate a PaperPlane for each item (Plane) in pbxPlanes
            for (int i = 0; i < pbxPlanes.Length; i++)
            {
                // +1 when assigning ID so we start at 1 not 0.
                myPaperPlanes[i] = new PaperPlane {
                    myPictureBox = pbxPlanes[i], planeID = (i + 1), planeStartingPositionX = pbxPlanes[i].Left
                };
                myPaperPlanes[i].myPictureBox.BackgroundImage = Resources.paperplane;
            }
        }
        public void Print_Im_a_paper_plane_On_Display()
        {
            var p = new PaperPlane();

            Assert.AreEqual(p.Display(), "I'm a paper plane!");
        }
        public void Print_Crash_On_Land()
        {
            var p = new PaperPlane();

            Assert.AreEqual(p.Land(), "Crash!");
        }
        public void Print_No_engine_to_start_On_StartEngine()
        {
            var p = new PaperPlane();

            Assert.AreEqual(p.SingleEnginePlane(), "No engine to start!");
        }
        public void Print_Flying_with_paper_wings_On_Fly()
        {
            var p = new PaperPlane();

            Assert.AreEqual(p.Fly(), "Flying with paper wings");
        }