Ejemplo n.º 1
0
        public void Should_MosaicToScreenLocation_When_AElementMoveIntoScreen2(
            int mosaicX, int mosaicY, int screenX, int screenY, int screenIndex)
        {
            var element = new Element(80, 80);

            var screen1 = new Screen(680, 627);
            var screen2 = new Screen(682, 627);

            var mosaic = new Mosaic();

            mosaic.AddNeighbor(screen1);
            mosaic.AddNeighbor(screen1, screen2, DirectionEnum.Right);

            element.Move(mosaicX, mosaicY);

            var result = mosaic.MosaicToScreenLocation(element, mosaic.Items[screenIndex].Screen);

            Assert.Equal <int>(screenX, result.X);
            Assert.Equal <int>(screenY, result.Y);
        }
Ejemplo n.º 2
0
        public void Should_MosaicToScreenLocation_When_AElementMoveIntoScreen(
            int mosaicX, int mosaicY, int screenX, int screenY, int screenIndex)
        {
            var element = new Element(50, 50);

            var screen1 = new Screen(200, 200);
            var screen2 = new Screen(100, 200);
            var screen3 = new Screen(200, 200);

            var mosaic = new Mosaic();

            mosaic.AddNeighbor(screen1);
            mosaic.AddNeighbor(screen1, screen2, DirectionEnum.Right);
            mosaic.AddNeighbor(screen2, screen3, DirectionEnum.Right);

            //Move element Screen 2 > Location > 250:100
            element.Move(mosaicX, mosaicY);

            var result = mosaic.MosaicToScreenLocation(element, mosaic.Items[screenIndex].Screen);

            Assert.Equal <int>(screenX, result.X);
            Assert.Equal <int>(screenY, result.Y);
        }