@Test public void testSnapRight() { final XElement mock = mock(XElement.class); final Rectangle mockRectangle = mock(Rectangle.class); final int testValueX_half = 11; final int testValueWidth_half = 3; final int testValueX = testValueX_half*2; final int testValueY = 17; final int testValueWidth = testValueWidth_half*2; final int testValueHeight = 5; when(mockRectangle.getX()).thenReturn(testValueX); when(mockRectangle.getY()).thenReturn(testValueY); when(mockRectangle.getWidth()).thenReturn(testValueWidth); when(mockRectangle.getHeight()).thenReturn(testValueHeight); when(mock.getBounds()).thenReturn(mockRectangle); IplantWindowBase uutSpy = spy(uut); uutSpy.doSnapRight(mock); verify(uutSpy).setPagePosition(eq(testValueWidth_half), eq(testValueY)); verify(uutSpy).setPixelSize(eq(testValueWidth_half), eq(testValueHeight)); }
void doSnapRight(XElement xElement) { setMaximized(false); Rectangle bounds = xElement.getBounds(); setPagePosition(bounds.getWidth()/2, bounds.getY()); setPixelSize(bounds.getWidth()/2, bounds.getHeight()); }
IplantWindowBase extends Window implements IPlantWindowInterface { void doSnapRight(XElement xElement) { setMaximized(false); Rectangle bounds = xElement.getBounds(); setPagePosition(bounds.getWidth()/2, bounds.getY()); setPixelSize(bounds.getWidth()/2, bounds.getHeight()); } }
IplantWindowBase extends Window implements IPlantWindowInterface { void doSnapRight(XElement xElement) { setMaximized(false); Rectangle bounds = xElement.getBounds(); setPagePosition(bounds.getWidth()/2, bounds.getY()); setPixelSize(bounds.getWidth()/2, bounds.getHeight()); } IplantWindowBase();  IplantWindowBase(final IplantWindowAppearance appearance); }
IplantWindowBase extends Window implements IPlantWindowInterface { void doSnapRight(XElement xElement) { setMaximized(false); Rectangle bounds = xElement.getBounds(); setPagePosition(bounds.getWidth()/2, bounds.getY()); setPixelSize(bounds.getWidth()/2, bounds.getHeight()); } IplantWindowBase();  IplantWindowBase(final IplantWindowAppearance appearance); @Override boolean isMaximized(); @Override boolean isMinimized(); @Override void minimize(); @Override Window asWindow(); @Override void show(final C windowConfig,
                                              final String tag,
                                              final boolean isMaximizable); @Override void update(C config); }
IplantWindowBase extends Window implements IPlantWindowInterface { void doSnapRight(XElement xElement) { setMaximized(false); Rectangle bounds = xElement.getBounds(); setPagePosition(bounds.getWidth()/2, bounds.getY()); setPixelSize(bounds.getWidth()/2, bounds.getHeight()); } IplantWindowBase();  IplantWindowBase(final IplantWindowAppearance appearance); @Override boolean isMaximized(); @Override boolean isMinimized(); @Override void minimize(); @Override Window asWindow(); @Override void show(final C windowConfig,
                                              final String tag,
                                              final boolean isMaximizable); @Override void update(C config);  }