use of com.squareup.otto.Subscribe in project FluxyAndroidTodo by armueller.
the class ActionCreatorTest method createSetTodoItemAsEditableActionTest.
@Test
public void createSetTodoItemAsEditableActionTest() {
final AtomicBoolean testDone = new AtomicBoolean(false);
actionBus.register(new Object() {
@Subscribe
public void addTodo(ViewAction action) {
assertThat(action.getData().get(ViewAction.DataKeys.ID, -1)).isEqualTo(10);
testDone.set(true);
}
});
actionCreator.createSetTodoItemAsEditableAction(10);
while (!testDone.get()) ;
}
use of com.squareup.otto.Subscribe in project FluxyAndroidTodo by armueller.
the class ActionCreatorTest method createToggleAllTodosCompleteActionTest.
@Test
public void createToggleAllTodosCompleteActionTest() {
final AtomicBoolean testDone = new AtomicBoolean(false);
actionBus.register(new Object() {
@Subscribe
public void addTodo(TodoAction action) {
assertThat(action.getType()).isEqualTo(TodoAction.ActionTypes.TOGGLE_ALL);
testDone.set(true);
}
});
actionCreator.createToggleAllTodosCompleteAction();
while (!testDone.get()) ;
}
use of com.squareup.otto.Subscribe in project FluxyAndroidTodo by armueller.
the class ActionCreatorTest method createDeleteAllCompleteTodosActionTest.
@Test
public void createDeleteAllCompleteTodosActionTest() {
final AtomicBoolean testDone = new AtomicBoolean(false);
actionBus.register(new Object() {
@Subscribe
public void addTodo(TodoAction action) {
assertThat(action.getType()).isEqualTo(TodoAction.ActionTypes.DELETE_ALL);
testDone.set(true);
}
});
actionCreator.createDeleteAllCompleteTodosAction();
while (!testDone.get()) ;
}
use of com.squareup.otto.Subscribe in project FluxyAndroidTodo by armueller.
the class ActionCreatorTest method createViewAllTodosActionTest.
@Test
public void createViewAllTodosActionTest() {
final AtomicBoolean testDone = new AtomicBoolean(false);
actionBus.register(new Object() {
@Subscribe
public void addTodo(ViewAction action) {
assertThat(action.getType()).isEqualTo(ViewAction.ActionTypes.VIEW_ALL);
testDone.set(true);
}
});
actionCreator.createViewAllTodosAction();
while (!testDone.get()) ;
}
use of com.squareup.otto.Subscribe in project FluxyAndroidTodo by armueller.
the class ActionCreatorTest method createEditTodoActionTest.
@Test
public void createEditTodoActionTest() {
final AtomicBoolean testDone = new AtomicBoolean(false);
actionBus.register(new Object() {
@Subscribe
public void addTodo(TodoAction action) {
assertThat(action.getData().get(TodoAction.DataKeys.ID, -1)).isEqualTo(10);
assertThat(action.getData().get(TodoAction.DataKeys.DESCRIPTION, "")).isEqualTo("New Description");
testDone.set(true);
}
});
actionCreator.createEditTodoAction(10, "New Description");
while (!testDone.get()) ;
}
Aggregations