namespace Tizen.Network.Connection.Tests
{
/* ***********************************************************************/
- // ** Scenario
+ // ** Scenario
// ** CellularAuthInformation test
- // **
+ // **
/* ***********************************************************************/
[TestFixture]
Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
}
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Check Property UserName is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Connection.CellularAuthInformation.UserName A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Nishant Chaprana, n.chaprana@samsung.com")]
+ public void UserName_PROPERTY_SET_GET()
+ {
+ try
+ {
+ /* Test Case */
+ var cellularAuthInfo = new CellularAuthInformation();
+ Assert.IsInstanceOf<CellularAuthInformation>(cellularAuthInfo, "Expecting CellularAuthInformation object");
+
+ string userName = "userName";
+ cellularAuthInfo.UserName = userName;
+ var actualUserName = cellularAuthInfo.UserName;
+ Assert.IsNotNull(actualUserName, "actualUserName value is null");
+ Assert.IsInstanceOf<string>(actualUserName, "actualUserName value is not of type string");
+ Assert.AreEqual(userName, actualUserName, "actualUserName property read is not successful");
+ }
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(isTelephonySupported == false, "Invalid NotSupportedException");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check Property Password is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Connection.CellularAuthInformation.Password A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Nishant Chaprana, n.chaprana@samsung.com")]
+ public void Password_PROPERTY_SET_GET()
+ {
+ try
+ {
+ /* Test Case */
+ var cellularAuthInfo = new CellularAuthInformation();
+ Assert.IsInstanceOf<CellularAuthInformation>(cellularAuthInfo, "Expecting CellularAuthInformation object");
+
+ string password = "password";
+ cellularAuthInfo.Password = password;
+ var actualPassword = cellularAuthInfo.Password;
+ Assert.IsNotNull(actualPassword, "actualPassword value is null");
+ Assert.IsInstanceOf<string>(actualPassword, "actualPassword value is not of type string");
+ Assert.AreEqual(password, actualPassword, "actualPassword property read is not successful");
+ }
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(isTelephonySupported == false, "Invalid NotSupportedException");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check Property AuthType is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Connection.CellularAuthInformation.AuthType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Nishant Chaprana, n.chaprana@samsung.com")]
+ public void AuthType_PROPERTY_SET_GET()
+ {
+ try
+ {
+ /* Test Case */
+ var cellularAuthInfo = new CellularAuthInformation();
+ Assert.IsInstanceOf<CellularAuthInformation>(cellularAuthInfo, "Expecting CellularAuthInformation object");
+
+ cellularAuthInfo.AuthType = CellularAuthType.None;
+ var authType = cellularAuthInfo.AuthType;
+ Assert.IsNotNull(authType, "authType value is null");
+ Assert.IsInstanceOf<CellularAuthType>(authType, "authType value is not of type string");
+ Assert.AreEqual(CellularAuthType.None.ToString(), cellularAuthInfo.AuthType.ToString(), "None Type of Auth can't set");
+
+ cellularAuthInfo.AuthType = CellularAuthType.Pap;
+ authType = cellularAuthInfo.AuthType;
+ Assert.IsNotNull(authType, "authType value is null");
+ Assert.IsInstanceOf<CellularAuthType>(authType, "authType value is not of type string");
+ Assert.AreEqual(CellularAuthType.Pap.ToString(), cellularAuthInfo.AuthType.ToString(), "Pap Type of Auth can't set");
+
+ cellularAuthInfo.AuthType = CellularAuthType.Chap;
+ authType = cellularAuthInfo.AuthType;
+ Assert.IsNotNull(authType, "authType value is null");
+ Assert.IsInstanceOf<CellularAuthType>(authType, "authType value is not of type CellularAuthType");
+ Assert.AreEqual(CellularAuthType.Chap.ToString(), cellularAuthInfo.AuthType.ToString(), "Chap Type of Auth can't set");
+ }
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(isTelephonySupported == false, "Invalid NotSupportedException");
+ }
+ }
}
}
}
}
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SetPassphrase method Exception when argument is null")]
+ [Property("SPEC", "Tizen.Network.Connection.WiFiProfile.SetPassphrase M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Nishant Chaprana, n.chaprana@samsung.com")]
+ public async Task SetPassphrase_CHECK_EXCEPTION_WHEN_ARG_IS_NULL()
+ {
+ try
+ {
+ /*
+ * PRECONDITION
+ * Activate WiFi then get WiFi connected
+ * Create a WiFiSecurity object
+ * Create a WiFiProfile object
+ */
+ await setUp();
+
+ /*
+ * TEST CODE
+ */
+ _wiFiProfile.SetPassphrase(null);
+ }
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(isWiFiSupported == false, "Invalid NotSupportedException");
+ }
+ catch (ArgumentNullException ex)
+ {
+ Assert.IsTrue(true, "Argument is null");
+ }
+ finally
+ {
+ if (_wiFiAp != null)
+ {
+ _wiFiAp.Dispose();
+ }
+ if (_wiFiProfile != null)
+ {
+ _wiFiProfile.Dispose();
+ }
+ }
+ }
}
}