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)); }
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)); }
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)); }