@@ -0,0 +1,1473 @@
+package com.evgenii.jsevaluatortests;%0A%0Aimport android.test.ActivityInstrumentationTestCase2;%0Aimport android.test.TouchUtils;%0Aimport android.test.suitebuilder.annotation.MediumTest;%0Aimport android.view.View;%0Aimport android.widget.Button;%0Aimport android.widget.TextView;%0A%0Apublic class PercentageActivityTest extends ActivityInstrumentationTestCase2%3CPercentageActivity%3E %7B%0A%09private PercentageActivity mActivity;%0A%0A%09public PercentageActivityTest() %7B%0A%09%09super(PercentageActivity.class);%0A%09%7D%0A%0A%09@Override%0A%09protected void setUp() throws Exception %7B%0A%09%09super.setUp();%0A%09%09mActivity = getActivity();%0A%09%7D%0A%0A%09@MediumTest%0A%09public void testEvaluateButton_clickButtonAndShowResult() %7B%0A%09%09final Button evaluateButton = (Button) mActivity%0A%09%09%09%09.findViewById(R.id.button_evaluate_percentage);%0A%0A%09%09final TextView resultTextView = (TextView) mActivity%0A%09%09%09%09.findViewById(R.id.percentageResultLabel);%0A%0A%09%09TouchUtils.clickView(this, evaluateButton);%0A%09%09assertTrue(View.VISIBLE == resultTextView.getVisibility());%0A%09%09assertEquals(%22Result: 5%257E 12.5%25 growth%22, resultTextView.getText());%0A%09%7D%0A%0A%09@MediumTest%0A%09public void testJsTextView_shouldHaveJsText() %7B%0A%09%09final TextView editJsTextView = (TextView) mActivity.findViewById(R.id.percentageCodeLabel);%0A%0A%09%09final String expected = mActivity.getString(R.string.percetage_js_code);%0A%09%09final String actual = editJsTextView.getText().toString();%0A%09%09assertEquals(expected, actual);%0A%09%7D%0A%0A%09public void testPreconditions() %7B%0A%09%09assertNotNull(%22mActivity is null%22, mActivity);%0A%09%7D%0A%0A%7D%0A

Test for percent handling