Skip to content

Commit

Permalink
fix:修改网络类型判断的测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
gio-yanruixue authored and tianhui12 committed Nov 23, 2021
1 parent 9aeebb3 commit 9045231
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ public void networkTest() {
Truth.assertThat(state.isMobileData()).isTrue();
Truth.assertThat(state.isConnected()).isTrue();
Truth.assertThat(state.getNetworkName()).isEqualTo("2G");
Truth.assertThat(NetworkUtil.getNetworkName(ConnectivityManager.TYPE_MOBILE, TelephonyManager.NETWORK_TYPE_CDMA, "Test Network")).isEqualTo("3G");
Truth.assertThat(NetworkUtil.getNetworkName(ConnectivityManager.TYPE_MOBILE, TelephonyManager.NETWORK_TYPE_CDMA, "Test Network")).isEqualTo("2G");
Truth.assertThat(NetworkUtil.getNetworkName(ConnectivityManager.TYPE_MOBILE, TelephonyManager.NETWORK_TYPE_TD_SCDMA, "Test Network")).isEqualTo("3G");
Truth.assertThat(NetworkUtil.getNetworkName(ConnectivityManager.TYPE_MOBILE, TelephonyManager.NETWORK_TYPE_LTE, "Test Network")).isEqualTo("4G");
Truth.assertThat(NetworkUtil.getNetworkName(ConnectivityManager.TYPE_MOBILE, TelephonyManager.NETWORK_TYPE_NR, "Test Network")).isEqualTo("5G");
Truth.assertThat(NetworkUtil.getNetworkName(ConnectivityManager.TYPE_WIFI, TelephonyManager.NETWORK_TYPE_LTE, "Test Network")).isEqualTo("WIFI");
}

Expand Down

0 comments on commit 9045231

Please sign in to comment.