From: Seonah Moon Date: Wed, 8 Aug 2018 04:42:47 +0000 (+0900) Subject: [Network][TCSACR-167][Add testcase to get DHCP lease duration] X-Git-Tag: tct5.0_m2~103^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ccb58160ca9fbee996b17d21c82842697654c11;p=test%2Ftct%2Fcsharp%2Fapi.git [Network][TCSACR-167][Add testcase to get DHCP lease duration] Change-Id: I10182c01503efacd6859b066c207230b45c77395 --- diff --git a/tct-suite-vs/Tizen.Network.Tests/testcase/TSIAddressInformation.cs b/tct-suite-vs/Tizen.Network.Tests/testcase/TSIAddressInformation.cs index d3553f2cc..afbfa8936 100755 --- a/tct-suite-vs/Tizen.Network.Tests/testcase/TSIAddressInformation.cs +++ b/tct-suite-vs/Tizen.Network.Tests/testcase/TSIAddressInformation.cs @@ -485,5 +485,54 @@ namespace Tizen.Network.Connection.Tests } } } + + [Test] + [Category("P1")] + [Description("Test DhcpLeaseDuration property of IAddressInformation")] + [Property("SPEC", "Tizen.Network.Connection.IAddressInformation.DhcpLeaseDuration A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Seonah Moon, seonah1.moon@samsung.com")] + public static async Task DhcpLeaseDuration_PROPERTY() + { + Log.Info(Globals.LogTag, "DhcpLeaseDuration_PROPERTY start"); + ConnectionProfile _connectionProfile = null; + try + { + /** PRECONDITION + * turn on a Public WiFi + **/ + await setUp(); + + /* TEST CODE */ + _connectionProfile = ConnectionProfileManager.GetCurrentProfile(); + Assert.IsNotNull(_connectionProfile); + var iAddressInformation = _connectionProfile.IPv4Settings; + Assert.IsNotNull(iAddressInformation, "IAddressInformation is NULL"); + + var duration = iAddressInformation.DhcpLeaseDuration; + Assert.IsTrue(duration >= 0, "Invalid dhcp lease duration"); + } + 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 (Exception ex) + { + Assert.True(false, "Exception occurs. Msg : " + ex.ToString()); + } + finally + { + if (_connectionProfile != null) + { + _connectionProfile.Dispose(); + } + } + + } } }