Move grouping separator preference to Output section

This commit is contained in:
serso
2016-05-02 13:57:29 +02:00
parent 0f7e5ee3ee
commit 1c6651bd4b
5 changed files with 57 additions and 27 deletions

View File

@@ -25,7 +25,9 @@ package org.solovyev.android.calculator.history;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.Looper;
import com.squareup.otto.Bus;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -35,19 +37,33 @@ import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.solovyev.android.CalculatorTestRunner;
import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.BuildConfig;
import org.solovyev.android.calculator.Display;
import org.solovyev.android.calculator.DisplayState;
import org.solovyev.android.calculator.Editor;
import org.solovyev.android.calculator.EditorState;
import org.solovyev.android.calculator.Engine;
import org.solovyev.android.calculator.ErrorReporter;
import org.solovyev.android.calculator.json.Json;
import org.solovyev.android.io.FileSystem;
import javax.annotation.Nonnull;
import java.io.File;
import java.util.List;
import static org.junit.Assert.*;
import javax.annotation.Nonnull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.*;
import static org.solovyev.android.calculator.Engine.Preferences.groupingSeparator;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.solovyev.android.calculator.Tests.sameThreadExecutor;
import static org.solovyev.android.calculator.jscl.JsclOperation.numeric;
@@ -106,8 +122,8 @@ public class HistoryTest {
@Test
public void testRecentHistoryShouldTakeIntoAccountGroupingSeparator() throws Exception {
when(history.preferences.contains(eq(groupingSeparator.getKey()))).thenReturn(true);
when(history.preferences.getString(eq(groupingSeparator.getKey()), anyString())).thenReturn(" ");
when(history.preferences.contains(eq(Engine.Preferences.Output.separator.getKey()))).thenReturn(true);
when(history.preferences.getString(eq(Engine.Preferences.Output.separator.getKey()), anyString())).thenReturn(" ");
addState("1");
addState("12");
addState("123");
@@ -119,7 +135,7 @@ public class HistoryTest {
assertEquals("12 345", states.get(0).editor.getTextString());
history.clearRecent();
when(history.preferences.getString(eq(groupingSeparator.getKey()), anyString())).thenReturn("'");
when(history.preferences.getString(eq(Engine.Preferences.Output.separator.getKey()), anyString())).thenReturn("'");
addState("1");
addState("12");
addState("123");