Assert.IsTrue(e.GetType().Name.Equals("ArgumentNullException"), "GetPrivacyDisplayName does not accept null input.");
}
}
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether privacy privilege status is true for account.read privilege when application itself declares the privilege and it is not offed.")]
- [Property("SPEC", "Tizen.Security.Privilege.GetPrivacyPrivilegeStatus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
- public void GetPrivacyPrivilegeStatus_RETURN_VALUE_TRUE()
- {
- try
- {
- var ret = Privilege.GetPrivacyPrivilegeStatus(accountReadPrivilege);
- Assert.IsInstanceOf<bool>(ret, "Object should be bool type.");
- Assert.IsTrue(ret, "Object is not equal");
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isPrivacyPrivilegeSupported == false, "Invalid NotSupportedException");
- }
- catch (Exception e)
- {
- Assert.Fail("Privilege.GetPrivacyPrivilegeStatus: " + e.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether privacy privilege status is false for contact.read privilege when application itself declares the privilege but it is offed.")]
- [Property("SPEC", "Tizen.Security.Privilege.GetPrivacyPrivilegeStatus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
- public void GetPrivacyPrivilegeStatus_RETURN_VALUE_FALSE()
- {
- try
- {
- var ret = Privilege.GetPrivacyPrivilegeStatus(contactReadPrivilege);
- Assert.IsInstanceOf<bool>(ret, "Object should be bool type.");
- Assert.IsFalse(ret, "Object is not equal");
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isPrivacyPrivilegeSupported == false, "Invalid NotSupportedException");
- }
- catch (Exception e)
- {
- Assert.Fail("Privilege.GetPrivacyPrivilegeStatus: " + e.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Get privacy privilege status with non-privacy related privilege to check ArgumentException exception")]
- [Property("SPEC", "Tizen.Security.Privilege.GetPrivacyPrivilegeStatus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
- public void GetPrivacyPrivilegeStatus_NOT_PRIVACY()
- {
- try
- {
- var ret = Privilege.GetPrivacyPrivilegeStatus(internetPrivilege);
- Assert.Fail("Expects to throw ArgumentException exception when privilege param is not-privacy related, but exception not thrown");
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isPrivacyPrivilegeSupported == false, "Invalid NotSupportedException");
- }
- catch (Exception e)
- {
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), "GetPrivacyPrivilegeStatus does not accept non-privacy related privilege.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Get privacy privilege status with null input parameter to check ArgumentException exception")]
- [Property("SPEC", "Tizen.Security.Privilege.GetPrivacyPrivilegeStatus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Yunjin Lee, yunjin-.lee@samsung.com")]
- public void GetPrivacyPrivilegeStatus_NULL_PARAM()
- {
- try
- {
- var ret = Privilege.GetPrivacyPrivilegeStatus(null);
- Assert.Fail("Expects to throw ArgumentException exception when null inputted for version param, but exception not thrown");
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isPrivacyPrivilegeSupported == false, "Invalid NotSupportedException");
- }
- catch (Exception e)
- {
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentNullException"), "GetPrivacyPrivilegeStatus does not accept null input parameter.");
- }
- }
-
}
}