ui_close(obj);
}
}
+
+CX_TEST(test_note_store_get_notebook_by_id) {
+ // it is important that this test is run after some other tests
+ // created some resources
+ CX_TEST_DO {
+ CX_TEST_ASSERT(!note_store_reload());
+ NoteStore *store = note_store_get();
+ CX_TEST_ASSERT(store && store->root && store->root->children);
+ CX_TEST_ASSERT(cxListSize(store->root->children) > 0);
+
+ CxIterator i = cxListIterator(store->root->children);
+ cx_foreach(Resource *, res, i) {
+ Resource *xres = note_store_get_notebook_by_id(res->resource_id);
+ CX_TEST_ASSERT(res == xres);
+ }
+ }
+}
+
CX_TEST(test_note_store_create_default);
CX_TEST(test_user_settings_is_valid);
+CX_TEST(test_note_store_get_notebook_by_id);
CX_TEST(test_note_store_reload);
CX_TEST(test_note_store_new_resource_async);
CX_TEST(test_note_store_new_notebook_async);
cx_test_register(suite, test_note_store_new_resource_async);
cx_test_register(suite, test_note_store_new_notebook_async);
cx_test_register(suite, test_note_store_save_resource_async);
+ cx_test_register(suite, test_note_store_get_notebook_by_id);
cx_test_register(suite, test_parse_markdown_para);
cx_test_register(suite, test_parse_markdown_formatting_simple);