From b59ff71755231dbbff4fdbd5d5e182303e2687e9 Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Mon, 11 Feb 2019 16:47:13 +0900 Subject: [PATCH] [WiFi][TCSACR-203][manual][Add testcases for TimeoutException] Change-Id: Ie34c44a22390aaacfe588e3b31fc3d81ed0ea0df Signed-off-by: Cheoleun Moon --- .../Tizen.WiFi.Manual.Tests/testcase/TSWiFiAP.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tct-suite-vs/Tizen.WiFi.Manual.Tests/testcase/TSWiFiAP.cs b/tct-suite-vs/Tizen.WiFi.Manual.Tests/testcase/TSWiFiAP.cs index 0007b4e..b3ab6f3 100755 --- a/tct-suite-vs/Tizen.WiFi.Manual.Tests/testcase/TSWiFiAP.cs +++ b/tct-suite-vs/Tizen.WiFi.Manual.Tests/testcase/TSWiFiAP.cs @@ -254,6 +254,49 @@ namespace Tizen.Network.WiFi.Tests Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); } } + + [Test] + [Category("P2")] + [Description("Check a connection to a WiFi AP by Wps")] + [Property("SPEC", "Tizen.Network.WiFi.WiFiAP.ConnectWpsWithoutSsidAsync M ")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Cheoleun Moon chleun.moon@samsung.com")] + [Precondition(1, "Activate WiFi")] + [Precondition(2, "Check if the device already connect to an AP. If so, forget it. There should not be any connected AP")] + [Step(1, "Tap the Run button")] + [Step(2, "Wait for TimeoutException (At most 3 minutes)")] + [Step(3, "Testcase will pass automatically if TimeoutException is successfully delivered")] + [Postcondition(1, "Forget the connected AP")] + [Postcondition(2, "Deactivate WiFi")] + public async Task ConnectWpsWithoutSsidAsync_TIMEOUT_EXCEPTION() + { + try + { + Log.Info(Globals.LogTag, "ConnectWpsWithoutSsidAsync_TIMEOUT_EXCEPTION"); + + WpsInfo info = new WpsPbcInfo(); + await WiFiAP.ConnectWpsWithoutSsidAsync(info); + + Assert.IsTrue(false, "TimeoutException should be thrown"); + } + catch (NotSupportedException) + { + Assert.IsTrue(isWiFiSupported == false, "Invalid NotSupportedException"); + } + catch (TypeInitializationException e) + { + Assert.IsTrue(isWiFiSupported == false && e.InnerException.GetType() == typeof(NotSupportedException), "Invalid NotSupportedException or TypeInitializationException"); + } + catch (TimeoutException ex) + { + Assert.IsTrue(true, "Exception occurs. Msg: " + ex.ToString()); + } + catch (Exception ex) + { + Assert.IsTrue(false, "Exception occurs. Msg: " + ex.ToString()); + } + } } } -- 2.7.4