[NUI][ACR-152][Update TCTs for Tizen.NUI] 82/188582/5
authorwenfeng.ge <wenfeng.ge@samsung.com>
Thu, 6 Sep 2018 08:23:11 +0000 (16:23 +0800)
committerwenfeng.ge <wenfeng.ge@samsung.com>
Fri, 7 Sep 2018 09:44:59 +0000 (17:44 +0800)
Change-Id: Iceeef782728e6c2b17787d98ad69ccd8356773ea
Signed-off-by: wenfeng.ge <wenfeng.ge@samsung.com>
tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs

diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs
new file mode 100755 (executable)
index 0000000..d34229b
--- /dev/null
@@ -0,0 +1,50 @@
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.BaseComponents;
+using System.Threading.Tasks;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+    [TestFixture]
+    [Description("Tizen.NUI.InputMethodContext Tests")]
+    public class InputMethodContextTests
+    {
+        private static string TAG = "NUI";
+
+        [SetUp]
+        public static void Init()
+        {
+            Tizen.Log.Info(TAG, "Init() is called!");
+            App.MainTitleChangeText("InputMethodContextTests");
+            App.MainTitleChangeBackgroundColor(null);
+        }
+
+        [TearDown]
+        public static void Destroy()
+        {
+            Tizen.Log.Info(TAG, "Destroy() is called!");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test TextPrediction. Check whether TextPrediction is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.InputMethodContext.TextPrediction A")]
+        [Property("SPEC_URL", " - ")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+        public void TextPrediction_SET_GET_VALUE()
+        {
+            /* TEST CODE */
+            InputMethodContext inputMethodContext = new InputMethodContext();
+            inputMethodContext.TextPrediction = true;
+            Assert.AreEqual(true, inputMethodContext.TextPrediction, "Should be true but error");
+            inputMethodContext.TextPrediction = false;
+            Assert.AreEqual(false, inputMethodContext.TextPrediction, "should be false but error");
+        }
+
+    }
+}
index b0b4c6b..4b2062e 100755 (executable)
@@ -392,6 +392,44 @@ namespace Tizen.NUI.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test SetKeyboardRepeatInfo.")]
+        [Property("SPEC", "Tizen.NUI.Window.SetKeyboardRepeatInfo M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+        public void SetKeyboardRepeatInfo_CHECK_VALUE()
+        {
+            /* TEST CODE */
+            Window window = Window.Instance;
+            bool ret = window.SetKeyboardRepeatInfo(3.0f, 0.05f);
+            Assert.IsTrue(ret, "Should be true");
+            float outRate, outDelay;
+            Tizen.Log.Debug(TAG, "return=" + ret + "  window.GetKeyboardRepeatInfo() =" + window.GetKeyboardRepeatInfo(out outRate, out outDelay));
+            Assert.AreEqual(3.0f, outRate, "out rate should be 3.0f but is " + outRate.ToString());
+            Assert.AreEqual(0.05f, outDelay, "out delay should be 0.05f but is " + outDelay.ToString());
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test GetKeyboardRepeatInfo.")]
+        [Property("SPEC", "Tizen.NUI.Window.GetKeyboardRepeatInfo M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
+        public void GetKeyboardRepeatInfo_CHECK_VALUE()
+        {
+            /* TEST CODE */
+            Window window = Window.Instance;
+            float outRate, outDelay;
+            window.SetKeyboardRepeatInfo(3.0f, 0.05f);
+            bool ret = window.GetKeyboardRepeatInfo(out outRate, out outDelay);
+            Assert.IsTrue(ret, "Should be true");
+            Assert.AreEqual(3.0f, outRate, "out rate should be 3.0f but is " + outRate.ToString());
+            Assert.AreEqual(0.05f, outDelay, "out delay should be 0.05f but is " + outDelay.ToString());
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test KeepRendering.")]
         [Property("SPEC", "Tizen.NUI.Window.KeepRendering M")]
         [Property("SPEC_URL", "-")]