From: Inhong Han Date: Mon, 11 Feb 2019 10:06:27 +0000 (+0900) Subject: [Inputmethod][TCSACR-212] Add new TCs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df93174c2a1ddae0aecdf3ce648810914f11ba03;p=test%2Ftct%2Fcsharp%2Fapi.git [Inputmethod][TCSACR-212] Add new TCs Change-Id: I58ac1752a2d5ecbccdc74cc5d1b5291e599e6d0e --- diff --git a/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSInputMethodEditor.cs b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSInputMethodEditor.cs index d667edd..ce29b80 100755 --- a/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSInputMethodEditor.cs +++ b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSInputMethodEditor.cs @@ -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(() => 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(() => 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 index 0000000..2236b27 --- /dev/null +++ b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSMimeTypeUpdateRequestedEventArgs.cs @@ -0,0 +1,50 @@ +using System; +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace Tizen.Uix.InputMethod.Tests +{ + [TestFixture] + [Description("Tizen.Uix.InputMethod.MimeTypeUpdateRequestedEventArgs test")] + public class TSMimeTypeUpdateRequestedEventArgsTests + { + private string _mimeType = "test"; + + [SetUp] + public void Init() + { + Helper.PrintLog(Type.DLogAndlogUtil, "Init"); + } + + [TearDown] + public void Destroy() + { + Helper.PrintLog(Type.DLogAndlogUtil, "Destroy"); + GC.Collect(); + } + + private void InputMethodEditor_MimeTypeUpdateRequested(object sender, MimeTypeUpdateRequestedEventArgs e) + { + _mimeType = e.MimeType; + } + + [Test] + [Category("P1")] + [Description("Check the MimeType property read only")] + [Property("SPEC", " Tizen.Uix.InputMethod.MimeTypeUpdateRequestedEventArgs.MimeType A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] + public void MimeType_READ_ONLY() + { + /* + * TEST CODE + */ + Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: MimeType_READ_ONLY"); + InputMethodEditor.MimeTypeUpdateRequested += InputMethodEditor_MimeTypeUpdateRequested; + Assert.AreEqual(_mimeType, "test", "Failed to retrieve MimeType"); + InputMethodEditor.MimeTypeUpdateRequested -= InputMethodEditor_MimeTypeUpdateRequested; + Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: MimeType_READ_ONLY"); + } + } +} 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 index 0000000..3f2fdce --- /dev/null +++ b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintDataUpdatedEventArgs.cs @@ -0,0 +1,71 @@ +using System; +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace Tizen.Uix.InputMethod.Tests +{ + [TestFixture] + [Description("Tizen.Uix.InputMethod.PredictionHintDataUpdatedEventArgs test")] + public class TSPredictionHintDataUpdatedEventArgsTests + { + private string _key = "test"; + private string _value = "test"; + + [SetUp] + public void Init() + { + Helper.PrintLog(Type.DLogAndlogUtil, "Init"); + } + + [TearDown] + public void Destroy() + { + Helper.PrintLog(Type.DLogAndlogUtil, "Destroy"); + GC.Collect(); + } + + private void InputMethodEditor_PredictionHintDataUpdated(object sender, PredictionHintDataUpdatedEventArgs e) + { + _key = e.Key; + _value = e.Value; + } + + [Test] + [Category("P1")] + [Description("Check the Key property read only")] + [Property("SPEC", " Tizen.Uix.InputMethod.PredictionHintDataUpdatedEventArgs.Key A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] + public void Key_READ_ONLY() + { + /* + * TEST CODE + */ + Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: Key_READ_ONLY"); + InputMethodEditor.PredictionHintDataUpdated += InputMethodEditor_PredictionHintDataUpdated; + Assert.AreEqual(_key, "test", "Failed to retrieve Key"); + InputMethodEditor.PredictionHintDataUpdated -= InputMethodEditor_PredictionHintDataUpdated; + Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: Key_READ_ONLY"); + } + + [Test] + [Category("P1")] + [Description("Check the Value property read only")] + [Property("SPEC", " Tizen.Uix.InputMethod.PredictionHintDataUpdatedEventArgs.Value A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] + public void Value_READ_ONLY() + { + /* + * TEST CODE + */ + Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: Value_READ_ONLY"); + InputMethodEditor.PredictionHintDataUpdated += InputMethodEditor_PredictionHintDataUpdated; + Assert.AreEqual(_value, "test", "Failed to retrieve Value"); + InputMethodEditor.PredictionHintDataUpdated -= InputMethodEditor_PredictionHintDataUpdated; + Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: Value_READ_ONLY"); + } + } +} 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 index 0000000..5c92d9e --- /dev/null +++ b/tct-suite-vs/Tizen.Inputmethod.Tests/testcase/TSPredictionHintUpdatedEventArgs.cs @@ -0,0 +1,50 @@ +using System; +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace Tizen.Uix.InputMethod.Tests +{ + [TestFixture] + [Description("Tizen.Uix.InputMethod.PredictionHintUpdatedEventArgs test")] + public class TSPredictionHintUpdatedEventArgsTests + { + private string _predictionHint = "test"; + + [SetUp] + public void Init() + { + Helper.PrintLog(Type.DLogAndlogUtil, "Init"); + } + + [TearDown] + public void Destroy() + { + Helper.PrintLog(Type.DLogAndlogUtil, "Destroy"); + GC.Collect(); + } + + private void InputMethodEditor_PredictionHintUpdated(object sender, PredictionHintUpdatedEventArgs e) + { + _predictionHint = e.PredictionHint; + } + + [Test] + [Category("P1")] + [Description("Check the PredictionHint property read only")] + [Property("SPEC", " Tizen.Uix.InputMethod.PredictionHintUpdatedEventArgs.PredictionHint A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] + public void PredictionHint_READ_ONLY() + { + /* + * TEST CODE + */ + Helper.PrintLog(Type.DLogAndlogUtil, "Executing TC: PredictionHint_READ_ONLY"); + InputMethodEditor.PredictionHintUpdated += InputMethodEditor_PredictionHintUpdated; + Assert.AreEqual(_predictionHint, "test", "Failed to retrieve PredictionHint"); + InputMethodEditor.PredictionHintUpdated -= InputMethodEditor_PredictionHintUpdated; + Helper.PrintLog(Type.DLogAndlogUtil, "Completed TC: PredictionHint_READ_ONLY"); + } + } +}