[Applications][TCSACR-536][Add new testcases] 01/291601/6
authorilho kim <ilho159.kim@samsung.com>
Tue, 18 Apr 2023 10:35:58 +0000 (19:35 +0900)
committerilho kim <ilho159.kim@samsung.com>
Tue, 25 Apr 2023 06:48:59 +0000 (15:48 +0900)
Added:
 - GetResourceControlAllowedResource_CHECK_RESULT()
 - GetResourceControlAllowedResource_INVALID_ARGUMENT()
 - GetResourceControlAllowedResource_INVALID_RESOURCE_TYPE()
 - GetResourceControlGlobalResource_CHECK_RESULT()
 - GetResourceControlGlobalResource_INVALID_ARGUMENT()
 - GetResourceControlGlobalResource_INVALID_RESOURCE_TYPE()

Change-Id: I0b5c2905a50fc17c3f58b7453235672d138c9be8
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
tct-suite-vs/Resource/Tizen.Applications.Tests/tizen.ai.model.rpk [new file with mode: 0644]
tct-suite-vs/Tizen.Applications.Tests/testcase/TSDirectoryInfo.cs

diff --git a/tct-suite-vs/Resource/Tizen.Applications.Tests/tizen.ai.model.rpk b/tct-suite-vs/Resource/Tizen.Applications.Tests/tizen.ai.model.rpk
new file mode 100644 (file)
index 0000000..1791f51
Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.Applications.Tests/tizen.ai.model.rpk differ
index 3e2b695..787af17 100755 (executable)
@@ -1,5 +1,7 @@
 using NUnit.Framework;
 using NUnit.Framework.TUnit;
+using System;
+using System.IO;
 
 namespace Tizen.Applications.Tests
 {
@@ -15,6 +17,8 @@ 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]
@@ -150,5 +154,93 @@ namespace Tizen.Applications.Tests
         {
             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));
+        }
     }
 }