From d79f898bcea6912ab98914a16048135ee0873393 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 1 Dec 2014 23:15:40 -0500 Subject: [PATCH] Properly rename defaultBookName to Initials --- .../format/osisparser/OsisParserTest.java | 58 ------------------- .../activity/viewer/BibleViewerModules.java | 2 +- .../viewer/BibleViewerPreferences.java | 1 + 3 files changed, 2 insertions(+), 59 deletions(-) delete mode 100644 app-test/src/test/java/org/bspeice/minimalbible/test/format/osisparser/OsisParserTest.java diff --git a/app-test/src/test/java/org/bspeice/minimalbible/test/format/osisparser/OsisParserTest.java b/app-test/src/test/java/org/bspeice/minimalbible/test/format/osisparser/OsisParserTest.java deleted file mode 100644 index 80d1822..0000000 --- a/app-test/src/test/java/org/bspeice/minimalbible/test/format/osisparser/OsisParserTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.bspeice.minimalbible.test.format.osisparser; - -import android.annotation.SuppressLint; - -import org.bspeice.minimalbible.service.format.osisparser.OsisParser; -import org.crosswire.jsword.book.OSISUtil; -import org.junit.Before; -import org.junit.Test; -import org.xml.sax.Attributes; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; - -/** - * State machine testing, oh boy! - */ -public class OsisParserTest { - - OsisParser parser; - - @Before - public void setUp() { - parser = new OsisParser(); - } - - @SuppressLint("NewApi") - @Test - public void testDoWriteEnabledVerse() { - Attributes attributes = mock(Attributes.class); - parser.startElement("", OSISUtil.OSIS_ELEMENT_VERSE, "", attributes); - assertTrue(parser.getDoWrite().peek()); - } - - @SuppressLint("NewApi") - private void parserAssert(OsisParser parser, String element) { - Attributes attributes = mock(Attributes.class); - parser.startElement("", element, "", attributes); - assertFalse(parser.getDoWrite().isEmpty()); - parser.getDoWrite().pop(); - } - - @Test - public void testDoWriteAlwaysAdded() { - parserAssert(parser, OSISUtil.OSIS_ELEMENT_VERSE); - parserAssert(parser, ""); - parserAssert(parser, "random string"); - parserAssert(parser, OSISUtil.OSIS_ELEMENT_CELL); - } - - @SuppressLint("NewApi") - @Test - public void testEndElementPopsQueue() { - parser.getDoWrite().add(true); - parser.endElement("", "", ""); - assertTrue(parser.getDoWrite().isEmpty()); - } -} diff --git a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java index e550051..9627a9d 100644 --- a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java +++ b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java @@ -78,7 +78,7 @@ public class BibleViewerModules { }) .toBlocking().first(); - prefs.defaultBookName(fallback.getName()); + prefs.defaultBookInitials(fallback.getName()); return fallback; } catch (NoSuchElementException e) { // If no books are installed, there's really nothing we can do... diff --git a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java index ccd9680..148bfc5 100644 --- a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java +++ b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java @@ -15,5 +15,6 @@ public interface BibleViewerPreferences { @Default(ofInt = 14) int baseTextSize(); + void baseTextSize(int baseTextSize); }