Exemplo n.º 1
0
            public void CalculateBounds_OneTile_Square_NegativeSize()
            {
                var mapSize     = 1;
                var cameraSize  = -1f;
                var yPosition   = 1f;
                var aspectRatio = 1f;

                Assert.Throws(typeof(ArgumentException), () => CameraMovement.CalculateBounds(mapSize, cameraSize, yPosition, aspectRatio));
            }
Exemplo n.º 2
0
            public void CalculateBounds_OneTile_Square()
            {
                var mapSize     = 1;
                var cameraSize  = 0.5f;
                var yPosition   = 1f;
                var aspectRatio = 1f;

                Assert.DoesNotThrow(() => CameraMovement.CalculateBounds(mapSize, cameraSize, yPosition, aspectRatio));
            }
Exemplo n.º 3
0
            public void CalculateBounds_TenTile_Wide()
            {
                var mapSize     = 10;
                var cameraSize  = 0.5f;
                var yPosition   = 1f;
                var aspectRatio = 1.77778f;

                Assert.DoesNotThrow(() => CameraMovement.CalculateBounds(mapSize, cameraSize, yPosition, aspectRatio));
            }
Exemplo n.º 4
0
            public void CalculateBounds_OneTile_Portail()
            {
                var mapSize     = 1;
                var cameraSize  = 0.5f;
                var yPosition   = 1f;
                var aspectRatio = 0.999f;

                Assert.Throws(typeof(ArgumentException), () => CameraMovement.CalculateBounds(mapSize, cameraSize, yPosition, aspectRatio));
            }
Exemplo n.º 5
0
            public void CalculateBounds_TenTile_Wide_OneSize()
            {
                var mapSize     = 10;
                var cameraSize  = 1f;
                var yPosition   = 1f;
                var aspectRatio = 1.5f;

                var bounds   = CameraMovement.CalculateBounds(mapSize, cameraSize, yPosition, aspectRatio);
                var expected = new Bounds(new Vector3(4.5f, yPosition, 4.5f), new Vector3(3.5f, 0, 4f) * 2);

                Assert.AreEqual(expected, bounds);
            }
Exemplo n.º 6
0
            public void CalculateBounds_OneTile_Square_HalfSize()
            {
                var mapSize     = 1;
                var cameraSize  = 0.5f;
                var yPosition   = 1f;
                var aspectRatio = 1f;

                var bounds   = CameraMovement.CalculateBounds(mapSize, cameraSize, yPosition, aspectRatio);
                var expected = new Bounds(new Vector3(0, yPosition, 0), Vector3.zero);

                Assert.AreEqual(expected, bounds);
            }