[NUI][TCSACR-267][Add CropToMask TC] 26/214726/3
authordongsug.song <dongsug.song@samsung.com>
Wed, 25 Sep 2019 23:23:38 +0000 (08:23 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Thu, 26 Sep 2019 10:49:06 +0000 (19:49 +0900)
Change-Id: Ibd6761918092aeb1e488929b762b6373592c9165
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
tct-suite-vs/Tizen.NUI.Tests/res/picture2.jpg [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Tests/res/star-mod.png [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Tests/testcase/TSImageView.cs

diff --git a/tct-suite-vs/Tizen.NUI.Tests/res/picture2.jpg b/tct-suite-vs/Tizen.NUI.Tests/res/picture2.jpg
new file mode 100755 (executable)
index 0000000..7a12aed
Binary files /dev/null and b/tct-suite-vs/Tizen.NUI.Tests/res/picture2.jpg differ
diff --git a/tct-suite-vs/Tizen.NUI.Tests/res/star-mod.png b/tct-suite-vs/Tizen.NUI.Tests/res/star-mod.png
new file mode 100755 (executable)
index 0000000..2e3212e
Binary files /dev/null and b/tct-suite-vs/Tizen.NUI.Tests/res/star-mod.png differ
index f675437..364832a 100755 (executable)
@@ -410,5 +410,71 @@ namespace Tizen.NUI.Tests
             imageView.SynchronosLoading = false;
             Assert.IsFalse(imageView.SynchronosLoading, "Should be false!");
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test CropToMask. Check whether CropToMask is readable and writable with true value.")]
+        [Property("SPEC", "Tizen.NUI.BaseComponents.ImageView.CropToMask A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public async Task CropToMask_SET_GET_TRUE_VALUE()
+        {
+            /* TEST CODE */
+            var imageView  = new ImageView();
+
+            Assert.IsNotNull(imageView, "Should not be a Null : ImageView");
+            Assert.IsInstanceOf<ImageView>(imageView, "Should be an instance of : ImageView");
+
+            imageView.ResourceUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture2.jpg";
+            imageView.AlphaMaskURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "star-mod.png";
+            imageView.Size2D = new Size2D(500, 500);
+
+            imageView.CropToMask = true;
+
+            Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance");
+            Assert.IsInstanceOf<Window>(Window.Instance, "Should be an instance of : Window.Instance");
+
+            Window.Instance.Add(imageView);
+
+            await Task.Delay(1000);
+
+            Assert.AreEqual(true, imageView.CropToMask, "Retrieved CropToMask should be equal to set value");
+
+            imageView.Unparent();
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test CropToMask. Check whether CropToMask is readable and writable with false value.")]
+        [Property("SPEC", "Tizen.NUI.BaseComponents.ImageView.CropToMask A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "dongsug.song@samsung.com")]
+        public async Task CropToMask_SET_GET_FALSE_VALUE()
+        {
+            /* TEST CODE */
+            var imageView = new ImageView();
+
+            Assert.IsNotNull(imageView, "Should not be a Null : ImageView");
+            Assert.IsInstanceOf<ImageView>(imageView, "Should be an instance of : ImageView");
+
+            imageView.ResourceUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture2.jpg";
+            imageView.AlphaMaskURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "star-mod.png";
+            imageView.Size2D = new Size2D(500, 500);
+            imageView.CropToMask = false;
+
+            Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance");
+            Assert.IsInstanceOf<Window>(Window.Instance, "Should be an instance of : Window.Instance");
+
+            Window.Instance.Add(imageView);
+
+            await Task.Delay(1000);
+
+            Assert.AreEqual(false, imageView.CropToMask, "Retrieved CropToMask should be equal to set value");
+
+            imageView.Unparent();
+        }
+
     }
 }
\ No newline at end of file