[NUI][TCSACR-354] Add ScrollPosition and ScrollCurrentPosition to ScrollableBase 98/244898/4
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 25 Sep 2020 09:02:01 +0000 (18:02 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 5 Oct 2020 06:46:07 +0000 (15:46 +0900)
Add ScrollPosition and ScrollCurrentPosition to ScrollableBase.

Change-Id: Ia4013e1f1e2590e631b04568759add54a8fe8985

tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollableBase.cs

index ec2b2f7..09ab3fc 100755 (executable)
@@ -534,5 +534,45 @@ namespace Tizen.NUI.Components.Tests
                 Assert.Fail("Caught Exception" + e.ToString());
             }
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test ScrollPosition. Check whether ScrollPosition returns the value expected.")]
+        [Property("SPEC", "Tizen.NUI.Components.ScrollableBase.ScrollPosition A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+        public void ScrollPosition_CHECK_GET_VALUE()
+        {
+            /* TEST CODE */
+            var scrollableBase = new ScrollableBase();
+            Assert.IsNotNull(scrollableBase, "Should be not null!");
+            Assert.IsInstanceOf<ScrollableBase>(scrollableBase, "Should return ScrollableBase instance.");
+            scrollableBase.Size = new Size(100, 100);
+            var contentContainer = scrollableBase.ContentContainer;
+            contentContainer.Position = new Position(50, 50);
+            Assert.AreEqual(-scrollableBase.ContentContainer.Position.X, scrollableBase.ScrollPosition.X, "Should be equals to the value of -ContentContainer.Position.X");
+            Assert.AreEqual(-scrollableBase.ContentContainer.Position.Y, scrollableBase.ScrollPosition.Y, "Should be equals to the value of -ContentContainer.Position.Y");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test ScrollCurrentPosition. Check whether ScrollCurrentPosition returns the value expected.")]
+        [Property("SPEC", "Tizen.NUI.Components.ScrollableBase.ScrollCurrentPosition A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+        public void ScrollCurrentPosition_CHECK_GET_VALUE()
+        {
+            /* TEST CODE */
+            var scrollableBase = new ScrollableBase();
+            Assert.IsNotNull(scrollableBase, "Should be not null!");
+            Assert.IsInstanceOf<ScrollableBase>(scrollableBase, "Should return ScrollableBase instance.");
+            scrollableBase.Size = new Size(100, 100);
+            var contentContainer = scrollableBase.ContentContainer;
+            contentContainer.Position = new Position(50, 50);
+            Assert.AreEqual(-scrollableBase.ContentContainer.CurrentPosition.X, scrollableBase.ScrollCurrentPosition.X, "Should be equals to the value of -ContentContainer.CurrentPosition.X");
+            Assert.AreEqual(-scrollableBase.ContentContainer.CurrentPosition.Y, scrollableBase.ScrollCurrentPosition.Y, "Should be equals to the value of -ContentContainer.CurrnetPosition.Y");
+        }
     }
 }