use of org.fossasia.openevent.app.data.models.dto.SimpleModel in project open-event-orga-app by fossasia.
the class LoggerTest method shouldLogItem.
@Test
public void shouldLogItem() {
SimpleModel simpleModel = new SimpleModel(2, "Title", "Description");
Logger.logSuccess(simpleModel);
verify(tree).i(contains(simpleModel.toString()));
}
use of org.fossasia.openevent.app.data.models.dto.SimpleModel in project open-event-orga-app by fossasia.
the class LoggerTest method shouldLogList.
@Test
public void shouldLogList() {
List simpleModel = Arrays.asList(new SimpleModel[] { new SimpleModel(2, "Title", "Description"), new SimpleModel(3, "New Title", "Good description") });
Logger.logSuccess(simpleModel);
verify(tree, atLeastOnce()).i(matches(".*\\b(List|count:|" + simpleModel.size() + ")\\b.*"));
}
use of org.fossasia.openevent.app.data.models.dto.SimpleModel in project open-event-orga-app by fossasia.
the class DatabaseChangeListenerTest method testUpdate.
@Test
public void testUpdate() throws InterruptedException {
databaseRepository.save(SimpleModel.class, DatabaseRepositoryTest.MODEL).subscribe();
SimpleModel newModel = SimpleModel.fromModel(DatabaseRepositoryTest.MODEL);
newModel.setDescription("Billy Bowden");
databaseRepository.update(SimpleModel.class, newModel).subscribe();
databaseChangeListener.stopListening();
notifier.lastOrError().test().assertValue(value -> value.getAction().equals(BaseModel.Action.UPDATE) && value.getModel().equals(newModel));
}
use of org.fossasia.openevent.app.data.models.dto.SimpleModel in project open-event-orga-app by fossasia.
the class DatabaseRepositoryTest method testUpdate.
@Test
public void testUpdate() {
databaseRepository.save(SimpleModel.class, MODEL).subscribe();
SimpleModel newModel = SimpleModel.fromModel(MODEL);
newModel.setDescription("Melshi Jones");
databaseRepository.update(SimpleModel.class, newModel).subscribe();
databaseRepository.getItems(SimpleModel.class, SimpleModel_Table.id.eq(1L)).test().assertValue(simpleModel -> simpleModel.getDescription().equals("Melshi Jones"));
}
Aggregations