[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSInputMethodOptions.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("internal/Common/InputMethodOptions")]
13     public class InternalInputMethodOptionsTest
14     {
15         private const string tag = "NUITEST";
16
17         [SetUp]
18         public void Init()
19         {
20             tlog.Info(tag, "Init() is called!");
21         }
22
23         [TearDown]
24         public void Destroy()
25         {
26             tlog.Info(tag, "Destroy() is called!");
27         }
28
29         [Test]
30         [Category("P1")]
31         [Description("InputMethodOptions constructor")]
32         [Property("SPEC", "Tizen.NUI.InputMethodOptions.InputMethodOptions C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void InputMethodOptionsConstructor()
37         {
38             tlog.Debug(tag, $"InputMethodOptionsConstructor START");
39
40             var testingTarget = new InputMethodOptions();
41             Assert.IsNotNull(testingTarget, "should be not null");
42             Assert.IsInstanceOf<InputMethodOptions>(testingTarget, "should be an instance of InputMethodOptions class!");
43
44             testingTarget.Dispose();
45             tlog.Debug(tag, $"InputMethodOptionsConstructor END (OK)");
46         }
47
48         [Test]
49         [Category("P1")]
50         [Description("InputMethodOptions IsPassword")]
51         [Property("SPEC", "Tizen.NUI.InputMethodOptions.IsPassword M")]
52         [Property("SPEC_URL", "-")]
53         [Property("CRITERIA", "MR")]
54         [Property("AUTHOR", "guowei.wang@samsung.com")]
55         public void InputMethodOptionsIsPassword()
56         {
57             tlog.Debug(tag, $"InputMethodOptionsIsPassword START");
58
59             var testingTarget = new InputMethodOptions();
60             Assert.IsNotNull(testingTarget, "should be not null");
61             Assert.IsInstanceOf<InputMethodOptions>(testingTarget, "should be an instance of InputMethodOptions class!");
62
63             tlog.Debug(tag, testingTarget.IsPassword().ToString());
64
65             testingTarget.Dispose();
66             tlog.Debug(tag, $"InputMethodOptionsIsPassword END (OK)");
67         }
68
69         [Test]
70         [Category("P1")]
71         [Description("InputMethodOptions ApplyProperty")]
72         [Property("SPEC", "Tizen.NUI.InputMethodOptions.ApplyProperty M")]
73         [Property("SPEC_URL", "-")]
74         [Property("CRITERIA", "MR")]
75         [Property("AUTHOR", "guowei.wang@samsung.com")]
76         public void InputMethodOptionsApplyProperty()
77         {
78             tlog.Debug(tag, $"InputMethodOptionsApplyProperty START");
79
80             var testingTarget = new InputMethodOptions();
81             Assert.IsNotNull(testingTarget, "should be not null");
82             Assert.IsInstanceOf<InputMethodOptions>(testingTarget, "should be an instance of InputMethodOptions class!");
83
84             using (PropertyMap settings = new PropertyMap())
85             {
86                 settings.Add("IsTextPredictionAllowed", new PropertyValue(false));
87
88                 try
89                 {
90                     testingTarget.ApplyProperty(settings);
91                 }
92                 catch (Exception e)
93                 {
94                     tlog.Debug(tag, e.Message.ToString());
95                     Assert.Fail("Caught Exception : Failed!");
96                 }
97             }
98
99             testingTarget.Dispose();
100             tlog.Debug(tag, $"InputMethodOptionsApplyProperty END (OK)");
101         }
102
103         [Test]
104         [Category("P1")]
105         [Description("InputMethodOptions RetrieveProperty")]
106         [Property("SPEC", "Tizen.NUI.InputMethodOptions.RetrieveProperty M")]
107         [Property("SPEC_URL", "-")]
108         [Property("CRITERIA", "MR")]
109         [Property("AUTHOR", "guowei.wang@samsung.com")]
110         public void InputMethodOptionsRetrieveProperty()
111         {
112             tlog.Debug(tag, $"InputMethodOptionsRetrieveProperty START");
113
114             var testingTarget = new InputMethodOptions();
115             Assert.IsNotNull(testingTarget, "should be not null");
116             Assert.IsInstanceOf<InputMethodOptions>(testingTarget, "should be an instance of InputMethodOptions class!");
117
118             using (PropertyMap settings = new PropertyMap())
119             {
120                 settings.Add("IsTextPredictionAllowed", new PropertyValue(false));
121
122                 try
123                 {
124                     testingTarget.RetrieveProperty(settings);
125                 }
126                 catch (Exception e)
127                 {
128                     tlog.Debug(tag, e.Message.ToString());
129                     Assert.Fail("Caught Exception : Failed!");
130                 }
131             }
132
133             testingTarget.Dispose();
134             tlog.Debug(tag, $"InputMethodOptionsRetrieveProperty END (OK)");
135         }
136
137         //[Test]
138         //[Category("P1")]
139         //[Description("InputMethodOptions CompareAndSet")]
140         //[Property("SPEC", "Tizen.NUI.InputMethodOptions.CompareAndSet M")]
141         //[Property("SPEC_URL", "-")]
142         //[Property("CRITERIA", "MR")]
143         //[Property("AUTHOR", "guowei.wang@samsung.com")]
144         //public void InputMethodOptionsCompareAndSet()
145         //{
146         //    tlog.Debug(tag, $"InputMethodOptionsCompareAndSet START");
147
148         //    var testingTarget = new InputMethodOptions();
149         //    Assert.IsNotNull(testingTarget, "should be not null");
150         //    Assert.IsInstanceOf<InputMethodOptions>(testingTarget, "should be an instance of InputMethodOptions class!");
151
152         //    var result = testingTarget.CompareAndSet(InputMethod.CategoryType.ActionButtonTitle, testingTarget, new SWIGTYPE_p_int(testingTarget.SwigCPtr.Handle));
153         //    tlog.Debug(tag, result.ToString());
154
155         //    testingTarget.Dispose();
156         //    tlog.Debug(tag, $"InputMethodOptionsCompareAndSet END (OK)");
157         //}
158     }
159 }