AreaPicker extends AppCompatEditText implements AreaView, OnClickListener { @Override public void setArea(Area area) { if (area == null) throw new IllegalArgumentException("area must not be null"); this.area = area; setText(area.prettyPrint()); if (listener != null) listener.onAreaChanged(area); } AreaPicker(Context context);  AreaPicker(Context context, AttributeSet attrs);  AreaPicker(Context context, AttributeSet attrs, int defStyleAttr); @Override Area getArea(); @Override void onClick(View view); @Override Parcelable onSaveInstanceState(); @Override void onRestoreInstanceState(Parcelable state); @Override void setArea(Area area); void setMaxRai(int maxRai); void setTitle(String title); void setOnAreaChangeListener(OnAreaChangedListener listener);  }
@Test public void testResetArea() throws Exception { areaPicker.setArea(new Area(2, 0, 30)); areaPicker.setArea(new Area(0)); assertEquals("", areaPicker.getText()); }
@Test public void testShowAreaRaiNganSquareWa() throws Exception { areaPicker.setArea(new Area(3, 3, 40)); assertEquals("3 ไร่ 3 งาน 40 ตารางวา", areaPicker.getText()); }
@Test public void testShowOnlyRai() throws Exception { areaPicker.setArea(new Area(2, 0, 0.0)); assertEquals("2 ไร่", areaPicker.getText()); }