@Test public void changeOperationNotAddsMessageToLogWithSameOperation() { viewModel.setOperation(Operation.XOR); int sizeFirst = viewModel.getLog().size(); viewModel.setOperation(Operation.XOR); assertEquals(viewModel.getLog().size(), sizeFirst); }
@Test public void changeOperationAddsMessageChangeOperation() { viewModel.setOperation(Operation.XOR); String message = viewModel.getLog().get(viewModel.getLog().size() - 1); assertTrue(message.matches(".*" + ViewModel.LogMessages.OPERATION_CHANGED + ".*")); }
@Test public void canDoXorOperation() { viewModel.setOperation(Operation.XOR); initArraysForOperations(); viewModel.doOperation(); assertNotNull(viewModel.getResultBitArray()); }
@Test public void doOperationAddsMessageToLog() { viewModel.setOperation(Operation.XOR); initArraysForOperations(); viewModel.doOperation(); assertFalse(viewModel.getLog().isEmpty()); }
@Test public void doOperationAddsMessageDidOperation() { viewModel.setOperation(Operation.XOR); initArraysForOperations(); viewModel.doOperation(); String message = viewModel.getLog().get(viewModel.getLog().size() - 1); assertTrue(message.matches(".*" + ViewModel.LogMessages.OPERATION_DID + ".*")); }
@Test public void changeOperationAddsMessageToLog() { viewModel.setOperation(Operation.XOR); assertFalse(viewModel.getLog().isEmpty()); }
@Test public void canSetOperation() { viewModel.setOperation(Operation.AND); assertEquals(Operation.AND, viewModel.getOperation()); }