Beispiel #1
0
        public void ifLengthIsZeroThenScaleIsZero()
        {
            Assert.AreEqual <double>(0, CoordinateCalculator.getScale(new Point(0, 0), new Point(0, 0), 0),
                                     "The scale of zero is correctely calculated");

            Assert.AreEqual <double>(0, CoordinateCalculator.getScale(new Point((float)3.25, (float)6.6666), new Point((float)8.99, (float)0.0005), 0),
                                     "The scale of zero is correctely calculated");
        }
Beispiel #2
0
        public void ifDistanceIsVerticalOrHorizontal()
        {
            Assert.AreEqual <double>(0.5, CoordinateCalculator.getScale(new Point(0, 0), new Point(1, 0), 2),
                                     "The scale of 1/2 is correctely calculated");

            Assert.AreEqual <double>(0.5, CoordinateCalculator.getScale(new Point(0, 0), new Point(0, 1), 2),
                                     "The scale of 1/2 is correctely calculated");
        }
Beispiel #3
0
        public void ifStartEndPointSameThenScaleIsZero()
        {
            Assert.AreEqual <double>(0, CoordinateCalculator.getScale(new Point(0, 0), new Point(0, 0), 20),
                                     "The scale of zero is correctely calculated");

            Assert.AreEqual <double>(0, CoordinateCalculator.getScale(new Point((float)5.14, (float)3.11), new Point((float)5.14, (float)3.11), 11.3),
                                     "The scale of zero is correctely calculated");
        }
Beispiel #4
0
 public void testScaleCalculation()
 {
     Assert.AreEqual <double>(2.5, CoordinateCalculator.getScale(new Point(0, 0), new Point(3, 4), 2),
                              "The scale of 5/2 is correctely calculated");
 }