Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e777bff authored by Peter S's avatar Peter S
Browse files

clean up useless tests, add new tests for changes

parent 5f655d60
Loading
Loading
Loading
Loading
+6 −41
Original line number Diff line number Diff line
@@ -507,50 +507,15 @@ public class NotesDatabaseTest {
    }

    @Test
    public void test_13_getTitleByCategoryId() {

        try {
            Method method_title_by_id = NotesDatabase.class.getDeclaredMethod("getTitleByCategoryId", long.class, int.class);
            method_title_by_id.setAccessible(true);

            // Remember we have a category named "Diary"? We can use tested method in test_12 to get category id
            Method method_id_by_title = NotesDatabase.class.getDeclaredMethod("getCategoryIdByTitle", long.class, String.class, boolean.class);
            method_id_by_title.setAccessible(true);
            int catId = (int) method_id_by_title.invoke(db, account.getId(), "Diary", true);
            String catTitle = (String) method_title_by_id.invoke(db, account.getId(), catId);

            Log.i("test_13_getTitleByCategoryId", "ID: " + catId + " Tile: " + catTitle);
            assertEquals("Diary", catTitle);

        } catch (Exception e) {
            fail(Arrays.toString(e.getStackTrace()));
            Log.e("Test_13_getTitleByCategoryId", Arrays.toString(e.getStackTrace()));
    public void test_13_getNotesCustom() {
        // TODO: ~
    }

    @Test
    public void test_14_searchCategories() {
        // TODO: ~
    }


    //    @Test
//    public void test_12_getNoteFromCursor(){
//        // pass
//    }

//    @Test
//    public void setCategory() {
//        // Unable to test with SSO
//    }
//
//    @Test
//    public void updateNoteAndSync() {
//        // Unable to test with SSO
//    }
//
//    @Test
//    public void updateNote() {
//        // can not check
//        // need remoteNote (note from server)
//    }

    public static String getCurDate() {
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
        return new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date());