예제 #1
0
        public void BasiLinksTest()
        {
            // arrange
            Kran kran = new Kran();

            Panel haken = new Panel();

            haken.Size     = new System.Drawing.Size(0, 0);
            haken.Location = new System.Drawing.Point(20, 20);

            Panel arm = new Panel();

            arm.Size     = new System.Drawing.Size(50, 50);
            arm.Location = new System.Drawing.Point(10, 10);

            Panel basi = new Panel();

            basi.Size     = new System.Drawing.Size(50, 50);
            basi.Location = new System.Drawing.Point(50, 50);

            Panel high = new Panel();

            high.Size     = new System.Drawing.Size(100, 10);
            high.Location = new System.Drawing.Point(10, 10);

            // act
            kran.BasiLinks(basi, arm, haken, high);

            // assert
            Assert.AreEqual(10, haken.Location.X);
            Assert.AreEqual(20, haken.Location.Y);
            Assert.AreEqual(0, arm.Location.X);
            Assert.AreEqual(10, arm.Location.Y);
            Assert.AreEqual(40, basi.Location.X);
            Assert.AreEqual(50, basi.Location.Y);
            Assert.AreEqual(0, high.Location.X);
            Assert.AreEqual(10, high.Location.Y);
        }
예제 #2
0
 private void Basis_Links(object sender, EventArgs e)
 {
     kran.BasiLinks(basi, arm, haken, high);
 }