{
try
{
- /*
- * PRECONDITION
- */
- await setUp();
+ var count = 0;
- /*
- * TEST CODE
- */
- var found = false;
- const int MAX_SCAN_TRY = 3;
- for (int i = 0; i < MAX_SCAN_TRY; i++)
+ if (!WiFiManager.IsActive)
{
- await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE1);
- var listAp = WiFiManager.GetFoundSpecificAPs();
- foreach (WiFiAP item in listAp)
- {
- if (item.NetworkInformation.Essid == networkParameter.wnPRIVATE1)
- {
- found = true;
- }
- item.Dispose();
- }
- if (found)
- {
- break;
- }
- await Task.Delay(1000);
+ await WiFiManager.ActivateAsync();
+ }
+ await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE);
+ var listApp = WiFiManager.GetFoundSpecificAPs();
+ await Task.Delay(1500);
+ foreach (var item in listApp)
+ {
+ count++;
+ item.Dispose();
}
- Assert.IsTrue(found, "ScanSpecificApAsync can't scan WiFi private");
+ Assert.Greater(count, 0, "ScanSpecificAPAsync fail");
Log.Info(Globals.LogTag, "Successfully done");
+
+ // POSTCONDITION
+ await setUp();
}
catch (NotSupportedException)
{