use of com.canoo.platform.samples.distribution.common.model.ToDoList in project dolphin-platform-examples by canoo.
the class ToDoControllerTests method testElementStateSync.
@Test
public void testElementStateSync() {
// given:
ControllerUnderTest<ToDoList> controllerUnderTest = createController(TODO_CONTROLLER_NAME);
ControllerUnderTest<ToDoList> controllerUnderTest2 = createController(TODO_CONTROLLER_NAME);
// when:
controllerUnderTest.getModel().getNewItemText().set("Banana");
controllerUnderTest.invoke(ADD_ACTION);
controllerUnderTest.invoke(CHANGE_ACTION, new Param(ITEM_PARAM, "Banana"));
// then:
Assert.assertEquals(controllerUnderTest2.getModel().getItems().size(), 1);
Assert.assertEquals(controllerUnderTest2.getModel().getItems().get(0).isCompleted(), true);
}
use of com.canoo.platform.samples.distribution.common.model.ToDoList in project dolphin-platform-examples by canoo.
the class ToDoControllerTests method testChangeElementState.
@Test
public void testChangeElementState() {
// given:
ControllerUnderTest<ToDoList> controllerUnderTest = createController(TODO_CONTROLLER_NAME);
// when:
controllerUnderTest.getModel().getNewItemText().set("Banana");
controllerUnderTest.invoke(ADD_ACTION);
controllerUnderTest.invoke(CHANGE_ACTION, new Param(ITEM_PARAM, "Banana"));
// then:
Assert.assertEquals(controllerUnderTest.getModel().getItems().get(0).isCompleted(), true);
}
use of com.canoo.platform.samples.distribution.common.model.ToDoList in project dolphin-platform-examples by canoo.
the class ToDoControllerTests method testDeleteElement.
@Test
public void testDeleteElement() {
// given:
ControllerUnderTest<ToDoList> controllerUnderTest = createController(TODO_CONTROLLER_NAME);
// when:
controllerUnderTest.getModel().getNewItemText().set("Banana");
controllerUnderTest.invoke(ADD_ACTION);
controllerUnderTest.invoke(REMOVE_ACTION, new Param(ITEM_PARAM, "Banana"));
// then:
Assert.assertEquals(controllerUnderTest.getModel().getItems().size(), 0);
}
use of com.canoo.platform.samples.distribution.common.model.ToDoList in project dolphin-platform-examples by canoo.
the class ToDoControllerTests method testElementDeleteSync.
@Test
public void testElementDeleteSync() {
// given:
ControllerUnderTest<ToDoList> controllerUnderTest = createController(TODO_CONTROLLER_NAME);
ControllerUnderTest<ToDoList> controllerUnderTest2 = createController(TODO_CONTROLLER_NAME);
// when:
controllerUnderTest.getModel().getNewItemText().set("Banana");
controllerUnderTest.invoke(ADD_ACTION);
controllerUnderTest.invoke(REMOVE_ACTION, new Param(ITEM_PARAM, "Banana"));
// then:
Assert.assertEquals(controllerUnderTest2.getModel().getItems().size(), 0);
}
Aggregations