get
{
Information.TryGetValue("http://tizen.org/feature/network.wifi", out bool isWiFiSupported);
- if (isWiFiSupported)
- {
- WiFiAP WifiAp = WiFiManager.GetConnectedAP();
- if (WifiAp != null)
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "WifiAp : " + WifiAp.NetworkInformation.Essid.ToString());
- WifiAp.Dispose();
- }
- }
-
Information.TryGetValue("http://tizen.org/feature/network.telephony", out bool isTelephonySupported);
Information.TryGetValue("http://tizen.org/feature/network.ethernet", out bool isEthernetSupported);
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG,
+ $"Wifi:{isWiFiSupported}, Telephony:{isTelephonySupported}, Ethernet:{isEthernetSupported}");
+
return isWiFiSupported | isTelephonySupported | isEthernetSupported;
}
}
{
if (!IsSupportable)
{
- Assert.Fail("No Wifi connection. Network support : " + IsSupportable);
+ Assert.Fail("Networks are not supported.");
}
- try
+ if (ConnectionState.Connected == ConnectionManager.WiFiState)
{
- var data = ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData);
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "LastReceivedData : " + data);
- Assert.IsTrue(data > 0, "LastReceivedData should not be 0");
+ WiFiAP WifiAp = WiFiManager.GetConnectedAP();
+ if (WifiAp != null)
+ {
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "WifiAp : " + WifiAp.NetworkInformation.Essid.ToString());
+ WifiAp.Dispose();
+ }
+
+ try
+ {
+ var data = ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData);
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TotalReceivedData : " + data);
+ if (data == 0)
+ Assert.Fail("TotalReceivedData should not be 0.");
+ }
+ catch (Exception ex)
+ {
+ Assert.Fail("Failed to get connection statistics. : " + ex.ToString());
+ }
}
- catch (Exception ex)
+ else
{
- Assert.Fail("Failed to get connection statistics. : " + ex.ToString());
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Wifi is not connected. Maybe another network is being used.");
}
}
}