添加单号码单元测试
This commit is contained in:
		| @@ -1,8 +1,8 @@ | ||||
| #Created by .winboll/winboll_app_build.gradle | ||||
| #Wed Mar 05 20:51:08 HKT 2025 | ||||
| #Thu Mar 06 11:57:56 GMT 2025 | ||||
| stageCount=11 | ||||
| libraryProject= | ||||
| baseVersion=1.0 | ||||
| publishVersion=1.0.10 | ||||
| buildCount=0 | ||||
| buildCount=2 | ||||
| baseBetaVersion=1.0.11 | ||||
|   | ||||
| @@ -7,6 +7,7 @@ import cc.winboll.studio.contacts.R; | ||||
| import cc.winboll.studio.contacts.dun.Rules; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.libappbase.LogView; | ||||
| import android.widget.EditText; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen@AliYun.Com | ||||
| @@ -26,6 +27,15 @@ public class UnitTestActivity extends Activity { | ||||
|         logView.start(); | ||||
|     } | ||||
|  | ||||
|     public void onTestPhone(View view) { | ||||
|         // 开始测试数据 | ||||
|         EditText etPhone = findViewById(R.id.phone_et); | ||||
|         Rules rules = Rules.getInstance(this); | ||||
|         String phone = etPhone.getText().toString().trim(); | ||||
|         LogUtils.d(TAG, String.format("Test phone : %s\n%s", phone, rules.isAllowed(phone))); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     public void onTestMain(View view) { | ||||
|         Rules rules = Rules.getInstance(this); | ||||
|  | ||||
|   | ||||
| @@ -6,9 +6,11 @@ | ||||
| 	android:layout_width="match_parent" | ||||
| 	android:layout_height="match_parent"> | ||||
|  | ||||
| 	<HorizontalScrollView | ||||
| 	<LinearLayout | ||||
| 		android:orientation="horizontal" | ||||
| 		android:layout_width="match_parent" | ||||
| 		android:layout_height="wrap_content"> | ||||
| 		android:layout_height="wrap_content" | ||||
| 		android:gravity="right"> | ||||
|  | ||||
| 		<Button | ||||
| 			android:layout_width="wrap_content" | ||||
| @@ -16,7 +18,34 @@ | ||||
| 			android:text="Test Main" | ||||
| 			android:onClick="onTestMain"/> | ||||
|  | ||||
| 	</HorizontalScrollView> | ||||
| 	</LinearLayout> | ||||
|  | ||||
| 	<LinearLayout | ||||
| 		android:orientation="horizontal" | ||||
| 		android:layout_width="match_parent" | ||||
| 		android:layout_height="wrap_content" | ||||
| 		android:gravity="center_vertical"> | ||||
|  | ||||
| 		<TextView | ||||
| 			android:layout_width="wrap_content" | ||||
| 			android:layout_height="wrap_content" | ||||
| 			android:text="测试号码:"/> | ||||
|  | ||||
| 		<EditText | ||||
| 			android:layout_width="0dp" | ||||
| 			android:inputType="phone" | ||||
| 			android:layout_height="wrap_content" | ||||
| 			android:ems="10" | ||||
| 			android:layout_weight="1.0" | ||||
| 			android:id="@+id/phone_et"/> | ||||
|  | ||||
| 		<Button | ||||
| 			android:layout_width="wrap_content" | ||||
| 			android:layout_height="wrap_content" | ||||
| 			android:text="Test Phone" | ||||
| 			android:onClick="onTestPhone"/> | ||||
|  | ||||
| 	</LinearLayout> | ||||
|  | ||||
| 	<cc.winboll.studio.libappbase.LogView | ||||
| 		android:layout_width="match_parent" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen