@Test public void countChecklistChars () { String content = CHECKED_SYM + "done\n" + UNCHECKED_SYM + "undone yet"; Note note = getNote(1L, "checklist", content); note.setChecklist(true); assertEquals(22, new DefaultWordCounter().countChars(note)); }
@Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }
DefaultWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); } }
DefaultWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }  }
DefaultWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }  @Override int countWords(Note note); @Override int countChars(Note note); }
DefaultWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }  @Override int countWords(Note note); @Override int countChars(Note note);  }