|
1 | 1 | package com.therouter.app.navigator;
|
2 | 2 |
|
| 3 | +import static com.therouter.ExtensionKt.require; |
| 4 | + |
3 | 5 | import android.os.Bundle;
|
4 | 6 | import android.view.View;
|
5 | 7 | import android.widget.Button;
|
@@ -86,42 +88,54 @@ protected void onCreate(Bundle savedInstanceState) {
|
86 | 88 |
|
87 | 89 | final TextView textView1 = findViewById(R.id.textview1);
|
88 | 90 | textView1.setText("接收int值传递:integer2=" + intValue);
|
| 91 | + require(intValue == 12345678, "NavigatorTargetActivity", "intValue数值不对"); |
89 | 92 |
|
90 | 93 | final TextView textView2 = findViewById(R.id.textview2);
|
91 | 94 | textView2.setText("用String传递int数据:" + stringIntValue);
|
| 95 | + require("12345678".equals(stringIntValue), "NavigatorTargetActivity", "stringIntValue数值不对"); |
92 | 96 |
|
93 | 97 | final TextView textView3 = findViewById(R.id.textview3);
|
94 | 98 | textView3.setText("接收包含大小写数字的String值传递:" + str_123_Value);
|
| 99 | + require("测试传中文字符串".equals(str_123_Value), "NavigatorTargetActivity", "str_123_Value数值不对"); |
95 | 100 |
|
96 | 101 | final TextView textView4 = findViewById(R.id.textview4);
|
97 | 102 | textView4.setText("接收故意传递非boolean值给boolean变量:" + boolParseError);
|
| 103 | + require(!boolParseError, "NavigatorTargetActivity", "boolParseError数值不对"); |
98 | 104 |
|
99 | 105 | final TextView textview4_1 = findViewById(R.id.textview4_1);
|
100 | 106 | textview4_1.setText("用字符串传一个很大的值给short变量:" + shortParseError);
|
| 107 | + require(0 == shortParseError, "NavigatorTargetActivity", "shortParseError数值不对"); |
101 | 108 |
|
102 | 109 | final TextView textView5 = findViewById(R.id.textview5);
|
103 | 110 | textView5.setText("接收boolean值:boolValue=" + boolValue);
|
| 111 | + require(boolValue, "NavigatorTargetActivity", "boolValue数值不对"); |
104 | 112 |
|
105 | 113 | final TextView textview6 = findViewById(R.id.textview6);
|
106 | 114 | textview6.setText("接收Long类型的值:longValue=" + longValue);
|
| 115 | + require(123456789012345L == longValue, "NavigatorTargetActivity", "longValue数值不对"); |
107 | 116 |
|
108 | 117 | final TextView textview7 = findViewById(R.id.textview7);
|
109 | 118 | textview7.setText("接收Char类型的值:" + charValue);
|
| 119 | + require('c' == charValue, "NavigatorTargetActivity", "charValue数值不对"); |
110 | 120 |
|
111 | 121 | final TextView textview8 = findViewById(R.id.textview8);
|
112 | 122 | textview8.setText("接收double类型的值(key与关键字同名情况):" + doubleValue);
|
| 123 | + require(3.14159265358972 == doubleValue, "NavigatorTargetActivity", "doubleValue数值不对"); |
113 | 124 |
|
114 | 125 | final TextView textview9 = findViewById(R.id.textview9);
|
115 | 126 | textview9.setText("接收float类型的值:" + floatValue);
|
| 127 | + require(3.1415927F == floatValue, "NavigatorTargetActivity", "floatValue数值不对"); |
116 | 128 |
|
117 | 129 | final TextView textview10 = findViewById(R.id.textview10);
|
118 | 130 | if (serializableBean != null) {
|
119 | 131 | textview10.setText("接收 SerializableObject 的值:" + serializableBean.hello);
|
| 132 | + require("helloField".equals(serializableBean.hello), "NavigatorTargetActivity", "serializableBean.hello数值不对"); |
120 | 133 | }
|
121 | 134 |
|
122 | 135 | final TextView textview11 = findViewById(R.id.textview11);
|
123 | 136 | if (parcelableBean != null) {
|
124 | 137 | textview11.setText("接收 ParcelableObject 的值:" + parcelableBean.hello);
|
| 138 | + require("helloField".equals(parcelableBean.hello), "NavigatorTargetActivity", "parcelableBean.hello数值不对"); |
125 | 139 | }
|
126 | 140 |
|
127 | 141 | if (button1 != null) {
|
|
0 commit comments