using NUnit.Framework;
using NUnit.Framework.TUnit;
+using System;
+using System.IO;
namespace Tizen.Applications.Tests
{
private const string ShareData = "/shared/data/";
private const string ShareResource = "/shared/res/";
private const string ShareTrusted = "/shared/trusted/";
+ private const string ResourceType = "tizen.ai.model";
+ private const string InvalidResourceType = "invalid.resource";
//need update test property SharedData;
[SetUp]
{
Assert.IsTrue(s_currentApp.SharedTrusted.Contains(ShareTrusted), "SharedTrusted of DirectoryInfo is not correct");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test method of DirectoryInfo.")]
+ [Property("SPEC", "Tizen.Applications.DirectoryInfo.GetResourceControlAllowedResource M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Ilho Kim, ilho159.kim@samsung.com")]
+ public void GetResourceControlAllowedResource_CHECK_RESULT()
+ {
+ try
+ {
+ string path = s_currentApp.GetResourceControlAllowedResource(ResourceType);
+ Assert.False(String.IsNullOrEmpty(path), "Fail to get resource control allowed path");
+ }
+ catch (Exception e)
+ {
+ Assert.True(false, e.Message);
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test method of DirectoryInfo with invalid argument.")]
+ [Property("SPEC", "Tizen.Applications.DirectoryInfo.GetResourceControlAllowedResource M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Ilho Kim, ilho159.kim@samsung.com")]
+ public void GetResourceControlAllowedResource_INVALID_ARGUMENT()
+ {
+ Assert.Throws<ArgumentException>(() => s_currentApp.GetResourceControlAllowedResource(null));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test method of DirectoryInfo with non existent resource package type")]
+ [Property("SPEC", "Tizen.Applications.DirectoryInfo.GetResourceControlAllowedResource M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Ilho Kim, ilho159.kim@samsung.com")]
+ public void GetResourceControlAllowedResource_INVALID_RESOURCE_TYPE()
+ {
+ Assert.Throws<DirectoryNotFoundException>(() => s_currentApp.GetResourceControlAllowedResource(InvalidResourceType));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test method of DirectoryInfo.")]
+ [Property("SPEC", "Tizen.Applications.DirectoryInfo.GetResourceControlGlobalResource M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Ilho Kim, ilho159.kim@samsung.com")]
+ public void GetResourceControlGlobalResource_CHECK_RESULT()
+ {
+ try
+ {
+ string path = s_currentApp.GetResourceControlGlobalResource(ResourceType);
+ Assert.False(String.IsNullOrEmpty(path), "Fail to get resource control global path");
+ }
+ catch (Exception e)
+ {
+ Assert.True(false, e.Message);
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test method of DirectoryInfo with invalid argument.")]
+ [Property("SPEC", "Tizen.Applications.DirectoryInfo.GetResourceControlGlobalResource M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Ilho Kim, ilho159.kim@samsung.com")]
+ public void GetResourceControlGlobalResource_INVALID_ARGUMENT()
+ {
+ Assert.Throws<ArgumentException>(() => s_currentApp.GetResourceControlGlobalResource(null));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test method of DirectoryInfo with non existent resource package type")]
+ [Property("SPEC", "Tizen.Applications.DirectoryInfo.GetResourceControlGlobalResource M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Ilho Kim, ilho159.kim@samsung.com")]
+ public void GetResourceControlGlobalResource_INVALID_RESOURCE_TYPE()
+ {
+ Assert.Throws<DirectoryNotFoundException>(() => s_currentApp.GetResourceControlGlobalResource(InvalidResourceType));
+ }
}
}