mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-25 06:16:15 +03:00
Fix Unit Tests
This commit is contained in:
parent
9a1ed65f24
commit
ba5b309d8f
2 changed files with 8 additions and 4 deletions
|
@ -25,9 +25,10 @@ public class NoteUtilTest extends TestCase {
|
|||
assertEquals("Test", NoteUtil.getLineWithoutMarkDown("Test", 0));
|
||||
assertEquals("Test", NoteUtil.getLineWithoutMarkDown("\nTest", 0));
|
||||
assertEquals("Foo", NoteUtil.getLineWithoutMarkDown("Foo\nBar", 0));
|
||||
assertEquals("Bar", NoteUtil.getLineWithoutMarkDown("Foo\nBar", 1));
|
||||
}
|
||||
|
||||
public void testGenerateTitle() {
|
||||
public void testGenerateNoteTitle() {
|
||||
assertEquals("Test", NoteUtil.generateNoteTitle("Test"));
|
||||
assertEquals("Test", NoteUtil.generateNoteTitle("Test\n"));
|
||||
assertEquals("Test", NoteUtil.generateNoteTitle("Test\nFoo"));
|
||||
|
@ -35,7 +36,10 @@ public class NoteUtilTest extends TestCase {
|
|||
assertEquals("Test", NoteUtil.generateNoteTitle("\n\nTest"));
|
||||
}
|
||||
|
||||
public void testGenerateExcerpt() {
|
||||
public void testGenerateNoteExcerpt() {
|
||||
assertEquals("Test", NoteUtil.generateNoteExcerpt("Test"));
|
||||
assertEquals("Foo", NoteUtil.generateNoteExcerpt("Test\nFoo"));
|
||||
assertEquals("Foo", NoteUtil.generateNoteExcerpt("Test\nFoo\nBar"));
|
||||
assertEquals("", NoteUtil.generateNoteExcerpt(""));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ public class NotesClientUtilTest extends TestCase {
|
|||
}
|
||||
|
||||
public void testIsValidURLTest() {
|
||||
assertTrue(NotesClientUtil.isValidURL("http://www.example.com/"));
|
||||
assertTrue(NotesClientUtil.isValidURL("https://www.example.com"));
|
||||
assertTrue(NotesClientUtil.isValidURL("https://demo.owncloud.org/"));
|
||||
assertFalse(NotesClientUtil.isValidURL("https://www.example.com/"));
|
||||
assertFalse(NotesClientUtil.isValidURL("htp://www.example.com/"));
|
||||
assertFalse(NotesClientUtil.isValidURL(null));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue