예제 #1
0
        public void WhenOutsideOfBounds_MovesToTheClosestScreen(Point location, Point expected, Rectangle [] screens)
        {
            var receiver = new TestLocationReceiver
            {
                Screens = screens
            };
            var setter = new LocationFixer(receiver);

            Assert.AreEqual(expected, setter.FixLocation(location));
        }
예제 #2
0
        public void WhenSettingLocationOnMultipleScreens_CanIntersectAdjacentScreens()
        {
            var receiver = new TestLocationReceiver
            {
                Screens = new[] { new Rectangle(0, 0, 1000, 1000), new Rectangle(1000, 0, 1000, 1000) }
            };
            var setter         = new LocationFixer(receiver);
            var targetLocation = new Point(950, 50);

            Assert.AreEqual(targetLocation, setter.FixLocation(targetLocation));
        }
예제 #3
0
        public void WhenSettingLocationInsideScreen_DoesNothing()
        {
            var receiver = new TestLocationReceiver
            {
                PrimaryScreen = new Rectangle(0, 0, 1000, 1000),
                Screens       = new[] { new Rectangle(0, 0, 1000, 1000) }
            };
            var setter         = new LocationFixer(receiver);
            var targetLocation = new Point(50, 50);

            Assert.AreEqual(targetLocation, setter.FixLocation(targetLocation));
        }