This commit is contained in:
Sergey Solovyev
2013-06-18 14:39:20 +04:00
parent 4840b6e25b
commit 072ee452ad
9 changed files with 52 additions and 51 deletions

View File

@@ -1,18 +1,24 @@
package org.solovyev.android.calculator;
import java.util.Date;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.solovyev.common.text.Strings;
/**
* User: serso
* Date: 10/13/12
* Time: 1:11 PM
*/
@Config(manifest = Config.DEFAULT)
@RunWith(value = RobolectricTestRunner.class)
public class AndroidCalculatorEditorViewTest {
@@ -34,7 +40,7 @@ public class AndroidCalculatorEditorViewTest {
@Test
public void testAsyncWork() throws Exception {
/* final int threadNum = 10;
final int threadNum = 10;
final int count = 10;
final int maxTextLength = 100;
@@ -78,6 +84,6 @@ public class AndroidCalculatorEditorViewTest {
Assert.assertFalse(error.get());
} else {
Assert.fail("Too long execution!");
}*/
}
}
}

View File

@@ -9,7 +9,8 @@ package org.solovyev.android.calculator;
import android.graphics.Color;
import jscl.MathEngine;
import jscl.NumeralBase;
import junit.framework.Assert;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.solovyev.android.calculator.text.TextProcessor;

View File

@@ -1,5 +1,8 @@
package org.solovyev.android.calculator.plot;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@@ -14,7 +17,14 @@ public class CalculatorGraph2dViewTest {
@Test
public void testFormatTick() throws Exception {
assertEquals("23324", CalculatorGraph2dView.formatTick(23324.0f, 0));
assertEquals("23324.1", CalculatorGraph2dView.formatTick(23324.1f, 1));
final DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
final DecimalFormatSymbols decimalFormatSymbols = format.getDecimalFormatSymbols();
if (',' == decimalFormatSymbols.getDecimalSeparator()) {
assertEquals("23324,1", CalculatorGraph2dView.formatTick(23324.1f, 1));
} else if ('.' == decimalFormatSymbols.getDecimalSeparator()) {
assertEquals("23324.1", CalculatorGraph2dView.formatTick(23324.1f, 1));
}
}
@Test

View File

@@ -4,7 +4,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.util.ActivityController;
import static org.junit.Assert.assertEquals;
@@ -15,7 +14,6 @@ import static org.junit.Assert.assertNotNull;
* Date: 6/17/13
* Time: 9:57 PM
*/
@Config(manifest = "android-app/AndroidManifest.xml")
@RunWith(value = RobolectricTestRunner.class)
public class CalculatorWizardActivityTest {
@@ -26,11 +24,8 @@ public class CalculatorWizardActivityTest {
controller.create();
final CalculatorWizardActivity activity = controller.get();
activity.onCreate(null);
assertNotNull(activity.getFlow());
assertNotNull(activity.getStep());
assertEquals(activity.getFlow().getFirstStep(), activity.getStep());
}
}