UnboundTerminal extends AbstractTerminal { @Override public void refresh(int y, int x) { getGrid().get(y, x).setDirty(false); } UnboundTerminal(); static UnboundTerminal initialize(String name, int rows, int cols, String font); @Override void disableEventNotice(BlackenEventType event); @Override void disableEventNotices(); @Override void enableEventNotice(BlackenEventType event); @Override @Deprecated void enableEventNotices(EnumSet<BlackenEventType> events); @Override int getch(); @Override int getch(int millis); @Override boolean keyWaiting(); @Override EnumSet<BlackenModifier> getLockingStates(); @Override BlackenMouseEvent getmouse(); @Override String getString(int y, int x, int length); @Override BlackenWindowEvent getwindow(); @Override void set(int y, int x, TerminalCellLike tcell); @Override boolean setFullScreen(boolean state); @Override boolean getFullScreen(); @Override void setSize(TerminalScreenSize size); @Override void refresh(int y, int x); @Override void setEventNotices(EnumSet<BlackenEventType> events); @Override EnumSet<BlackenEventType> getEventNotices(); @Override BlackenImageLoader getImageLoader();  }
@Test @Covers("public void refresh()") public void refresh() { assertEquals(-1, terminal.getCursorY()); assertEquals(-1, terminal.getCursorX()); assertFalse(terminal.get(0, 0).isDirty()); assertFalse(terminal.get(0, 1).isDirty()); assertFalse(terminal.get(0, 2).isDirty()); assertFalse(terminal.get(0, 3).isDirty()); terminal.get(0, 0).setSequence("N"); terminal.get(0, 1).setSequence("i"); terminal.get(0, 2).setSequence("c"); terminal.get(0, 3).setSequence("e"); assertTrue(terminal.get(0, 0).isDirty()); assertTrue(terminal.get(0, 1).isDirty()); assertTrue(terminal.get(0, 2).isDirty()); assertTrue(terminal.get(0, 3).isDirty()); terminal.refresh(); assertFalse(terminal.get(0, 0).isDirty()); assertFalse(terminal.get(0, 1).isDirty()); assertFalse(terminal.get(0, 2).isDirty()); assertFalse(terminal.get(0, 3).isDirty()); assertEquals(-1, terminal.getCursorY()); assertEquals(-1, terminal.getCursorX()); }
@Test @Covers("public void refresh(int,int)") public void refresh_y_x() { assertEquals(-1, terminal.getCursorY()); assertEquals(-1, terminal.getCursorX()); assertFalse(terminal.get(0, 0).isDirty()); assertFalse(terminal.get(0, 1).isDirty()); assertFalse(terminal.get(0, 2).isDirty()); assertFalse(terminal.get(0, 3).isDirty()); terminal.get(0, 0).setSequence("N"); terminal.get(0, 1).setSequence("i"); terminal.get(0, 2).setSequence("c"); terminal.get(0, 3).setSequence("e"); assertTrue(terminal.get(0, 0).isDirty()); assertTrue(terminal.get(0, 1).isDirty()); assertTrue(terminal.get(0, 2).isDirty()); assertTrue(terminal.get(0, 3).isDirty()); terminal.refresh(0, 0); terminal.refresh(0, 1); terminal.refresh(0, 2); terminal.refresh(0, 3); assertFalse(terminal.get(0, 0).isDirty()); assertFalse(terminal.get(0, 1).isDirty()); assertFalse(terminal.get(0, 2).isDirty()); assertFalse(terminal.get(0, 3).isDirty()); assertEquals(-1, terminal.getCursorY()); assertEquals(-1, terminal.getCursorX()); }