private int getMaxExpressionLineCount() { return this.getCells() .values() .stream() .filter(cell -> cell != null && cell.getValue() != null) .map(GridCell::getValue) .filter(value -> value instanceof BaseGridCellValue) .map(value -> (BaseGridCellValue) value) .filter(value -> value.getValue() != null) .map(value -> value.getValue().toString()) .map(value -> value.split("\\r?\\n", -1).length) .reduce(Integer::max) .orElse(0); } }
@Test @SuppressWarnings("unchecked") public void editTrueToFalse() { final GridCell<Boolean> cell = new BaseGridCell<>(new BaseGridCellValue<>(true)); column.edit(cell, context, callback); verify(callback, times(1)).accept(callbackArgumentCaptor.capture()); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertFalse(callbackArgument.getValue()); }
@Test @SuppressWarnings("unchecked") public void editTrueToFalse() { final GridCell<Boolean> cell = new BaseGridCell<>(new BaseGridCellValue<>(true)); column.edit(cell, context, callback); verify(callback, times(1)).accept(callbackArgumentCaptor.capture()); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertFalse(callbackArgument.getValue()); }
@Test @SuppressWarnings("unchecked") public void editTrueToFalse() { when( access.isEditable() ).thenReturn( true ); final GridCell<Boolean> cell = new BaseGridCell<>( new BaseGridCellValue<>( true ) ); column.edit( cell, context, callback ); verify( callback, times( 1 ) ).accept( callbackArgumentCaptor.capture() ); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertFalse( callbackArgument.getValue() ); }
@Test @SuppressWarnings("unchecked") public void editFalseToTrue() { when( access.isEditable() ).thenReturn( true ); final GridCell<Boolean> cell = new BaseGridCell<>( new BaseGridCellValue<>( false ) ); column.edit( cell, context, callback ); verify( callback, times( 1 ) ).accept( callbackArgumentCaptor.capture() ); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertTrue( callbackArgument.getValue() ); }
@Test @SuppressWarnings("unchecked") public void editFalseToTrue() { final GridCell<Boolean> cell = new BaseGridCell<>(new BaseGridCellValue<>(false)); column.edit(cell, context, callback); verify(callback, times(1)).accept(callbackArgumentCaptor.capture()); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertTrue(callbackArgument.getValue()); } }
@Test @SuppressWarnings("unchecked") public void editFalseToTrue() { final GridCell<Boolean> cell = new BaseGridCell<>(new BaseGridCellValue<>(false)); column.edit(cell, context, callback); verify(callback, times(1)).accept(callbackArgumentCaptor.capture()); final BaseGridCellValue<Boolean> callbackArgument = callbackArgumentCaptor.getValue(); assertTrue(callbackArgument.getValue()); } }