Ejemplo n.º 1
0
        public void TestThrowOnTooLargeRectangle()
        {
            CygonRectanglePacker packer = new CygonRectanglePacker(128, 128);

            Assert.Throws <OutOfSpaceException>(
                delegate() { packer.Pack(129, 129); }
                );
        }
Ejemplo n.º 2
0
        public void TestBarelyFittingRectangle()
        {
            CygonRectanglePacker packer = new CygonRectanglePacker(128, 128);

            Point placement = packer.Pack(128, 128);

            Assert.AreEqual(new Point(0, 0), placement);
        }
Ejemplo n.º 3
0
        public void TestTooLargeRectangle()
        {
            CygonRectanglePacker packer = new CygonRectanglePacker(128, 128);
            Point placement;

            bool result = packer.TryPack(129, 10, out placement);

            Assert.IsFalse(result);

            result = packer.TryPack(10, 129, out placement);
            Assert.IsFalse(result);
        }