From fdef9990d48e4adf999fdd538a0ecb0836f098e5 Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Sun, 4 Mar 2018 20:37:45 -0600 Subject: [PATCH] Fix broken tests --- .../simplemarkdown/ExampleUnitTest.java | 17 ----------------- .../com/wbrawner/simplemarkdown/UtilsTest.java | 10 +++++----- 2 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 app/src/test/java/com/wbrawner/simplemarkdown/ExampleUnitTest.java diff --git a/app/src/test/java/com/wbrawner/simplemarkdown/ExampleUnitTest.java b/app/src/test/java/com/wbrawner/simplemarkdown/ExampleUnitTest.java deleted file mode 100644 index 5e85141..0000000 --- a/app/src/test/java/com/wbrawner/simplemarkdown/ExampleUnitTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.wbrawner.simplemarkdown; - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file diff --git a/app/src/test/java/com/wbrawner/simplemarkdown/UtilsTest.java b/app/src/test/java/com/wbrawner/simplemarkdown/UtilsTest.java index f7258f7..e3236d5 100644 --- a/app/src/test/java/com/wbrawner/simplemarkdown/UtilsTest.java +++ b/app/src/test/java/com/wbrawner/simplemarkdown/UtilsTest.java @@ -4,8 +4,8 @@ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; +import com.wbrawner.simplemarkdown.utility.Constants; import com.wbrawner.simplemarkdown.utility.Utils; -import com.wbrawner.simplemarkdown.view.activity.SettingsActivity; import org.junit.After; import org.junit.Before; @@ -44,13 +44,13 @@ public class UtilsTest { @Test public void getDocsPath() throws Exception { - sharedPreferences.edit().putString(SettingsActivity.KEY_DOCS_PATH, rootDir).apply(); + sharedPreferences.edit().putString(Constants.KEY_DOCS_PATH, rootDir).apply(); assertEquals(rootDir, Utils.getDocsPath(context)); } @Test public void getDefaultFileName() throws Exception { - sharedPreferences.edit().putString(SettingsActivity.KEY_DOCS_PATH, rootDir).apply(); + sharedPreferences.edit().putString(Constants.KEY_DOCS_PATH, rootDir).apply(); new File(rootDir, "dummy.md").createNewFile(); new File(rootDir, "dummy1.md").createNewFile(); @@ -72,7 +72,7 @@ public class UtilsTest { @Test public void getDefaultFileNameDoubleDigitTest() throws IOException { - sharedPreferences.edit().putString(SettingsActivity.KEY_DOCS_PATH, rootDir).apply(); + sharedPreferences.edit().putString(Constants.KEY_DOCS_PATH, rootDir).apply(); for (int i = 0; i < 11; i++) { new File(rootDir, "Untitled-" + i + ".md").createNewFile(); @@ -85,7 +85,7 @@ public class UtilsTest { @Test public void isAutosaveEnabled() throws Exception { assertTrue(Utils.isAutosaveEnabled(context)); - sharedPreferences.edit().putBoolean(SettingsActivity.KEY_AUTOSAVE, false).apply(); + sharedPreferences.edit().putBoolean(Constants.KEY_AUTOSAVE, false).apply(); assertFalse(Utils.isAutosaveEnabled(context)); }