Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions TemperatureConverter/res/layout/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

<com.example.i2at.tc.EditNumber
android:id="@+id/celsius"
android:text="@+id/EditText01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="celsius"
android:gravity="left|center_vertical"
android:gravity="right|center_vertical"
android:inputType="numberDecimal"
android:tag="celsius" >

Expand All @@ -33,7 +32,6 @@

<com.example.i2at.tc.EditNumber
android:id="@+id/fahrenheit"
android:text="@+id/EditText02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="fahrenheit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package com.example.i2at.tc.test;

import static android.test.ViewAsserts.assertRightAligned;
import static android.test.ViewAsserts.assertVerticalCenterAligned;
import android.app.Instrumentation;
import android.test.ActivityInstrumentationTestCase2;
import android.test.UiThreadTest;
Expand All @@ -13,10 +15,13 @@
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.example.i2at.tc.EditNumber;
import com.example.i2at.tc.TemperatureConverter;
import com.example.i2at.tc.TemperatureConverterActivity;
//import com.lge.assertiontestapp.R;

/**
* @author diego
Expand Down Expand Up @@ -80,13 +85,21 @@ public void testFieldsShouldStartEmpty() {
/* TODO #1. 최소 실행 시 각 field 는 비워져 있어야 함
* field : mCelsius, mFahrenheit
*/
assertTrue("".equals(mCelsius.getText().toString()));
assertTrue("".equals(mFahrenheit.getText().toString()));
}

@SmallTest
public void testJustification() {
/* TODO 3: 숫자는 오른쪽 정렬로 되어야 하고 수직 중앙 정렬되어야 함
* Hint: EditText.getGravity()
*/
int celsiusGravity = mCelsius.getGravity();
int fahrenheitGravity = mFahrenheit.getGravity();

assertEquals((Gravity.RIGHT|Gravity.CENTER_VERTICAL), celsiusGravity);
assertEquals((Gravity.RIGHT|Gravity.CENTER_VERTICAL), fahrenheitGravity);

}

@SmallTest
Expand Down