添加单号码单元测试
This commit is contained in:
parent
05a9fc5275
commit
4bb814308b
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#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
|
stageCount=11
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=1.0
|
baseVersion=1.0
|
||||||
publishVersion=1.0.10
|
publishVersion=1.0.10
|
||||||
buildCount=0
|
buildCount=2
|
||||||
baseBetaVersion=1.0.11
|
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.contacts.dun.Rules;
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import cc.winboll.studio.libappbase.LogView;
|
import cc.winboll.studio.libappbase.LogView;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen@AliYun.Com
|
* @Author ZhanGSKen@AliYun.Com
|
||||||
@ -26,6 +27,15 @@ public class UnitTestActivity extends Activity {
|
|||||||
logView.start();
|
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) {
|
public void onTestMain(View view) {
|
||||||
Rules rules = Rules.getInstance(this);
|
Rules rules = Rules.getInstance(this);
|
||||||
|
|
||||||
|
@ -6,9 +6,11 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<HorizontalScrollView
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -16,7 +18,34 @@
|
|||||||
android:text="Test Main"
|
android:text="Test Main"
|
||||||
android:onClick="onTestMain"/>
|
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
|
<cc.winboll.studio.libappbase.LogView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user