示例#1
0
        public float JsonPassiveTree_MaxImageZoomLevel(float[] imageZoomLevels)
        {
            var tree = new JsonPassiveTree
            {
                ImageZoomLevels = imageZoomLevels
            };

            return(tree.MaxImageZoomLevel);
        }
示例#2
0
        public void JsonPassiveTree_ImageRoot(string imageRoot)
        {
            var tree = new JsonPassiveTree
            {
                ImageRoot = imageRoot
            };

            Assert.IsTrue(tree.ImageRoot.StartsWith('/'));
            Assert.IsTrue(tree.ImageRoot.EndsWith('/'));
            Assert.IsFalse(tree.ImageRoot.Contains(tree.WebCDN.AbsoluteUri));
        }
示例#3
0
        public void JsonPassiveTree_Bounds(float minX, float minY, float maxX, float maxY)
        {
            var tree = new JsonPassiveTree
            {
                MinX = minX,
                MinY = minY,
                MaxX = maxX,
                MaxY = maxY
            };

            Assert.AreEqual(tree.MinX, tree.Bounds.Left, $"{nameof(tree.MinX)} doesn't equal {nameof(tree.Bounds)}.{nameof(tree.Bounds.Left)}");
            Assert.AreEqual(tree.MinY, tree.Bounds.Top, $"{nameof(tree.MinY)} doesn't equal {nameof(tree.Bounds)}.{nameof(tree.Bounds.Top)}");
            Assert.AreEqual(tree.MaxX, tree.Bounds.Right, $"{nameof(tree.MaxX)} doesn't equal {nameof(tree.Bounds)}.{nameof(tree.Bounds.Right)}");
            Assert.AreEqual(tree.MaxY, tree.Bounds.Bottom, $"{nameof(tree.MaxY)} doesn't equal {nameof(tree.Bounds)}.{nameof(tree.Bounds.Bottom)}");
        }