using NUnit.Framework.TUnit;
using System;
using Tizen.Applications;
+using Tizen.System;
namespace Tizen.Security.Tests
{
private static PackageType tpk = PackageType.TPK;
private static PackageType wgt = PackageType.WGT;
+ static bool isPrivacyPrivilegeSupported = true;
+
[SetUp]
public static void Init()
{
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST");
+ Information.TryGetValue("http://tizen.org/feature/security.privacy_privilege", out isPrivacyPrivilegeSupported);
}
[TearDown]
Assert.IsNotNull(ret, "Privacy display name should not be null.");
Assert.IsTrue(ret.Length >= 0, "Length of Privacy display name should be greater than 0.");
}
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(isPrivacyPrivilegeSupported == false, "Invalid NotSupportedException");
+ }
catch (Exception e)
{
Assert.Fail("Privilege.GetPrivacyDisplayName: " + e.ToString());
var ret = Privilege.GetPrivacyDisplayName(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"), "GetPrivacyDisplayName does not accept non-privacy related privilege.");
var ret = Privilege.GetPrivacyDisplayName(null);
Assert.Fail("Expects to throw ArgumentException exception when null inputted for privilege param, but exception not thrown");
}
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(isPrivacyPrivilegeSupported == false, "Invalid NotSupportedException");
+ }
catch (Exception e)
{
Assert.IsTrue(e.GetType().Name.Equals("ArgumentNullException"), "GetPrivacyDisplayName does not accept null input.");
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());
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());
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.");
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.");