/// <summary> /// Build IExecutionMain and start the logic. /// </summary> public void Execute() { IWindowHandle windowHandle = new LastActiveWindowHandle(); IScreen screen = new ActiveWindowDependendScreen(windowHandle); IMoveWindow moveWindow = new MoveActiveWindow(windowHandle); IChangeWindowPosition position = new SplitActiveWindowToHalfBottomOnCurrentScreen(screen, moveWindow); IWindowTitle windowTitle = new ActiveWindowTitle(windowHandle); IPluginState pluginState = new ActiveWindowTitleNotStartMenuePluginState(windowTitle); IExecutionMain executionMain = new MoveActiveWindowPositionExecutionMain(position, pluginState); executionMain.Run(); }
public void Run_PluginStateTrue_CallsPositionMoverOnce() { // Arrange var windowPositionMover = Substitute.For<IChangeWindowPosition>(); var pluginState = Substitute.For<IPluginState>(); pluginState.State.Returns(true); var sut = new MoveActiveWindowPositionExecutionMain(windowPositionMover, pluginState); // Act sut.Run(); // Assert windowPositionMover.Received(1).Now(); }