public void Now_CallsMoveWindowWithScreenWorkingAreaXAndYWorkingWidthAndHalfWorkingHeight( int workingX, int workingY, int workingWidth, int workingHeight) { using (ShimsContext.Create()) { // Arrange var screen = Substitute.For<IScreen>(); var moveWindow = Substitute.For<IMoveWindow>(); var halfWorkingHeight = workingHeight / 2; var screenShim = new ShimScreen { WorkingAreaGet = () => new Rectangle(workingX, workingY, workingWidth, workingHeight) }; screen.Value.Returns(screenShim); var sut = new SplitActiveWindowToHalfTopOnCurrentScreen(screen, moveWindow); // Act sut.Now(); // Assert moveWindow.Received(1).To(workingX, workingY, workingWidth, halfWorkingHeight); } }
public void Now_CallsMoveWindowWithScreenWorkingAreaXAndYWith1024AndHeight768(int workingX, int workingY) { using (ShimsContext.Create()) { // Arrange var screen = Substitute.For<IScreen>(); var moveWindow = Substitute.For<IMoveWindow>(); var screenShim = new ShimScreen { WorkingAreaGet = () => new Rectangle(workingX, workingY, 100, 100) }; screen.Value.Returns(screenShim); var sut = new ResizeActiveWindowTo1024X768OnTopLeftOfCurrentScreen(screen, moveWindow); // Act sut.Now(); // Assert moveWindow.Received(1).To(workingX, workingY, 1024, 768); } }