コード例 #1
0
 public void QuadScalingUpTest()
 {
     Quadrilateral myquad = new Quadrilateral(2, 2, 2, 2);
     myquad.Scale(50);
     Assert.AreEqual(3, myquad.Top);
     Assert.AreEqual(3, myquad.Bottom);
     Assert.AreEqual(3, myquad.Left);
     Assert.AreEqual(3, myquad.Right);
 }
コード例 #2
0
 public void QuadScaleDownTest()
 {
     //negative scalinhg
     Quadrilateral myquad = new Quadrilateral(10, 10, 10, 10);
     myquad.Scale(-50);
     Assert.AreEqual(5, myquad.Top);
     Assert.AreEqual(5, myquad.Bottom);
     Assert.AreEqual(5, myquad.Left);
     Assert.AreEqual(5, myquad.Right);
 }
コード例 #3
0
 public void QuadScaleDownTest()
 {
     // Negative scaling
     // Likewise, 10 - 5 (50% of 10) = 5
     Quadrilateral myquad = new Quadrilateral(10, 10, 10, 10);
     myquad.Scale(-50);
     Assert.AreEqual(5, myquad.Top);
     Assert.AreEqual(5, myquad.Bottom);
     Assert.AreEqual(5, myquad.Left);
     Assert.AreEqual(5, myquad.Right);
 }
コード例 #4
0
 public void InvalidScaleArgument()
 {
     Quadrilateral myquad = new Quadrilateral(2, 2, 2, 2);
     myquad.Scale(0);
 }