[Inputmethod][TCSACR-212] Add new TCs 41/199441/5
authorInhong Han <inhong1.han@samsung.com>
Mon, 11 Feb 2019 10:06:27 +0000 (19:06 +0900)
committerInhong Han <inhong1.han@samsung.com>
Thu, 7 Mar 2019 06:56:14 +0000 (15:56 +0900)
Change-Id: I58ac1752a2d5ecbccdc74cc5d1b5291e599e6d0e

tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSInputMethodEditor.cs
tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSMimeTypeUpdateRequestedEventArgs.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintDataUpdatedEventArgs.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintUpdatedEventArgs.cs [new file with mode: 0755]

index d667edd..ce29b80 100755 (executable)
@@ -1042,6 +1042,123 @@ namespace Tizen.Uix.InputMethod.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Check the working of GetSelectedText method for No Exception")]
+        [Property("SPEC", "Tizen.Uix.InputMethod.InputMethodEditor.GetSelectedText M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]
+        public void GetSelectedText_NO_EXCEPTION()
+        {
+            /*
+             * TEST CODE
+             */
+            try
+            {
+                Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: GetSelectedText_NO_EXCEPTION");
+                string text = "test";
+                text = InputMethodEditor.GetSelectedText();
+                Assert.AreNotEqual(text, "test");
+                Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: GetSelectedText_NO_EXCEPTION");
+            }
+            catch (Exception e)
+            {
+                Helper.PrintLog(Type.DLogAndlogUtil, "Caught Exception" + e.ToString());
+                Assert.IsTrue(false, "Caught Exception" + e.ToString());
+            }
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check the working of SendPrivateCommand method for No Exception")]
+        [Property("SPEC", "Tizen.Uix.InputMethod.InputMethodEditor.SendPrivateCommand M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]
+        public void SendPrivateCommand_NO_EXCEPTION()
+        {
+            /*
+             * TEST CODE
+             */
+            flag = false;
+            try
+            {
+                Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: SendPrivateCommand_NO_EXCEPTION");
+                InputMethodEditor.SendPrivateCommand("Test");
+                flag = true;
+                Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: SendPrivateCommand_NO_EXCEPTION");
+            }
+            catch (Exception e)
+            {
+                Helper.PrintLog(Type.DLogAndlogUtil, "Caught Exception" + e.ToString());
+                Assert.IsTrue(false, "Caught Exception" + e.ToString());
+            }
+            Assert.IsTrue(flag, "Failed test");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Check the working of SendPrivateCommand method for InvalidOperationException")]
+        [Property("SPEC", "Tizen.Uix.InputMethod.InputMethodEditor.SendPrivateCommand M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]
+        public void SendPrivateCommand_CHECK_EXCEPTION()
+        {
+            /*
+             * TEST CODE
+             */
+            Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: SendPrivateCommand_CHECK_EXCEPTION");
+            Assert.Throws<InvalidOperationException>(() => InputMethodEditor.SendPrivateCommand(null));
+            Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: SendPrivateCommand_CHECK_EXCEPTION");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check the working of CommitContent method for No Exception")]
+        [Property("SPEC", "Tizen.Uix.InputMethod.InputMethodEditor.CommitContent M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]
+        public void CommitContent_NO_EXCEPTION()
+        {
+            /*
+             * TEST CODE
+             */
+            flag = false;
+            try
+            {
+                Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: CommitContent_NO_EXCEPTION");
+                InputMethodEditor.CommitContent("Test1", "Test2", "Test3");
+                flag = true;
+                Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: CommitContent_NO_EXCEPTION");
+            }
+            catch (Exception e)
+            {
+                Helper.PrintLog(Type.DLogAndlogUtil, "Caught Exception" + e.ToString());
+                Assert.IsTrue(false, "Caught Exception" + e.ToString());
+            }
+            Assert.IsTrue(flag, "Failed test");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Check the working of CommitContent method for InvalidOperationException")]
+        [Property("SPEC", "Tizen.Uix.InputMethod.InputMethodEditor.CommitContent M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]
+        public void CommitContent_CHECK_EXCEPTION()
+        {
+            /*
+             * TEST CODE
+             */
+            Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: CommitContent_CHECK_EXCEPTION");
+            Assert.Throws<InvalidOperationException>(() => InputMethodEditor.CommitContent("Test1", null, "Test3"));
+            Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: CommitContent_CHECK_EXCEPTION");
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Initialize the BoolAction delegate")]
         [Property("SPEC", " Tizen.Uix.InputMethod.InputMethodEditor.BoolAction M")]
         [Property("SPEC_URL", "-")]
diff --git a/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSMimeTypeUpdateRequestedEventArgs.cs b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSMimeTypeUpdateRequestedEventArgs.cs
new file mode 100755 (executable)
index 0000000..2236b27
--- /dev/null
@@ -0,0 +1,50 @@
+using System;\r
+using NUnit.Framework;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace Tizen.Uix.InputMethod.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.Uix.InputMethod.MimeTypeUpdateRequestedEventArgs test")]\r
+    public class TSMimeTypeUpdateRequestedEventArgsTests\r
+    {\r
+        private string _mimeType = "test";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Init");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Destroy");\r
+            GC.Collect();\r
+        }\r
+\r
+        private void InputMethodEditor_MimeTypeUpdateRequested(object sender, MimeTypeUpdateRequestedEventArgs e)\r
+        {\r
+            _mimeType = e.MimeType;\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check the MimeType property read only")]\r
+        [Property("SPEC", " Tizen.Uix.InputMethod.MimeTypeUpdateRequestedEventArgs.MimeType A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]\r
+        public void MimeType_READ_ONLY()\r
+        {\r
+            /*\r
+             * TEST CODE\r
+             */\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: MimeType_READ_ONLY");\r
+            InputMethodEditor.MimeTypeUpdateRequested += InputMethodEditor_MimeTypeUpdateRequested;\r
+            Assert.AreEqual(_mimeType, "test", "Failed to retrieve MimeType");\r
+            InputMethodEditor.MimeTypeUpdateRequested -= InputMethodEditor_MimeTypeUpdateRequested;\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: MimeType_READ_ONLY");\r
+        }\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintDataUpdatedEventArgs.cs b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintDataUpdatedEventArgs.cs
new file mode 100755 (executable)
index 0000000..3f2fdce
--- /dev/null
@@ -0,0 +1,71 @@
+using System;\r
+using NUnit.Framework;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace Tizen.Uix.InputMethod.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.Uix.InputMethod.PredictionHintDataUpdatedEventArgs test")]\r
+    public class TSPredictionHintDataUpdatedEventArgsTests\r
+    {\r
+        private string _key = "test";\r
+        private string _value = "test";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Init");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Destroy");\r
+            GC.Collect();\r
+        }\r
+\r
+        private void InputMethodEditor_PredictionHintDataUpdated(object sender, PredictionHintDataUpdatedEventArgs e)\r
+        {\r
+            _key = e.Key;\r
+            _value = e.Value;\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check the Key property read only")]\r
+        [Property("SPEC", " Tizen.Uix.InputMethod.PredictionHintDataUpdatedEventArgs.Key A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]\r
+        public void Key_READ_ONLY()\r
+        {\r
+            /*\r
+             * TEST CODE\r
+             */\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: Key_READ_ONLY");\r
+            InputMethodEditor.PredictionHintDataUpdated += InputMethodEditor_PredictionHintDataUpdated;\r
+            Assert.AreEqual(_key, "test", "Failed to retrieve Key");\r
+            InputMethodEditor.PredictionHintDataUpdated -= InputMethodEditor_PredictionHintDataUpdated;\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: Key_READ_ONLY");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check the Value property read only")]\r
+        [Property("SPEC", " Tizen.Uix.InputMethod.PredictionHintDataUpdatedEventArgs.Value A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]\r
+        public void Value_READ_ONLY()\r
+        {\r
+            /*\r
+             * TEST CODE\r
+             */\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: Value_READ_ONLY");\r
+            InputMethodEditor.PredictionHintDataUpdated += InputMethodEditor_PredictionHintDataUpdated;\r
+            Assert.AreEqual(_value, "test", "Failed to retrieve Value");\r
+            InputMethodEditor.PredictionHintDataUpdated -= InputMethodEditor_PredictionHintDataUpdated;\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: Value_READ_ONLY");\r
+        }\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintUpdatedEventArgs.cs b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintUpdatedEventArgs.cs
new file mode 100755 (executable)
index 0000000..5c92d9e
--- /dev/null
@@ -0,0 +1,50 @@
+using System;\r
+using NUnit.Framework;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace Tizen.Uix.InputMethod.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.Uix.InputMethod.PredictionHintUpdatedEventArgs test")]\r
+    public class TSPredictionHintUpdatedEventArgsTests\r
+    {\r
+        private string _predictionHint = "test";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Init");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Destroy");\r
+            GC.Collect();\r
+        }\r
+\r
+        private void InputMethodEditor_PredictionHintUpdated(object sender, PredictionHintUpdatedEventArgs e)\r
+        {\r
+            _predictionHint = e.PredictionHint;\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check the PredictionHint property read only")]\r
+        [Property("SPEC", " Tizen.Uix.InputMethod.PredictionHintUpdatedEventArgs.PredictionHint A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")]\r
+        public void PredictionHint_READ_ONLY()\r
+        {\r
+            /*\r
+             * TEST CODE\r
+             */\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: PredictionHint_READ_ONLY");\r
+            InputMethodEditor.PredictionHintUpdated += InputMethodEditor_PredictionHintUpdated;\r
+            Assert.AreEqual(_predictionHint, "test", "Failed to retrieve PredictionHint");\r
+            InputMethodEditor.PredictionHintUpdated -= InputMethodEditor_PredictionHintUpdated;\r
+            Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: PredictionHint_READ_ONLY");\r
+        }\r
+    }\r
+}\r