コード例 #1
0
        public void ExpandToSquare_BoundingBoxFCenter_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(-135.0f, -45.0f, 135.0f, 45.0f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxF, RelativePosition.Center);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #2
0
        public void ExpandToSquare_BoundingBoxFBottom_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(-135.0f, -30.0f, 135.0f, 60.0f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxF, RelativePosition.Bottom);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #3
0
        public void ExpandToSquare_BoundingBoxBCenter_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(-12.3f, -68.4f, 78.9f, 22.8f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxB, RelativePosition.Center);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #4
0
        public void ExpandToSquare_BoundingBoxERight_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(-80.0f, -0.0f, 10.0f, 90.0f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxE, RelativePosition.Right);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #5
0
        public void ExpandToSquare_BoundingBoxBBottom_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(-12.3f, -45.6f, 78.9f, 45.6f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxB, RelativePosition.Bottom);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #6
0
        public void ExpandToSquare_BoundingBoxABottomRight_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(6.9f, 3.1f, 42.0f, 38.2f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxA, RelativePosition.BottomRight);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #7
0
        public void ExpandToSquare_BoundingBoxATopLeft_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(6.9f, -10.1f, 42.0f, 25.0f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxA, RelativePosition.TopLeft);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #8
0
        public void ExpandToSquare_BoundingBoxACenter_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(6.9f, -3.5f, 42.0f, 31.6f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxA, RelativePosition.Center);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #9
0
        public void ExpandToSquare_BoundingBoxB_CorrectResults()
        {
            BoundingBox expected = new BoundingBox(-12.3f, -90.0f, 78.9f, 1.2f);
            BoundingBox actual   = BoundingBoxUtils.ExpandToSquare(_boundingBoxB);

            CompareBoundingBoxes(expected, actual);
        }
コード例 #10
0
 public void ExpandToSquare_BoundingBoxC_CorrectResults()
 {
     // All Positions should return the original bounding box for this test case.
     foreach (RelativePosition position in Enum.GetValues(typeof(RelativePosition)))
     {
         BoundingBox result = BoundingBoxUtils.ExpandToSquare(_boundingBoxC, position);
         CompareBoundingBoxes(result, _boundingBoxC);
     }
 }
コード例 #11
0
 public void ExpandToSquare_BoundingBoxBTop_ThrowsException()
 {
     // The start latitude in this case would be -91.2, which is not allowed.
     Assert.Throws(typeof(Exception), () => BoundingBoxUtils.ExpandToSquare(_boundingBoxB, RelativePosition.Top));
 }