3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("internal/Common/InputMethodOptions")]
13 public class InternalInputMethodOptionsTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
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()
38 tlog.Debug(tag, $"InputMethodOptionsConstructor START");
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!");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"InputMethodOptionsConstructor END (OK)");
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()
57 tlog.Debug(tag, $"InputMethodOptionsIsPassword START");
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!");
63 tlog.Debug(tag, testingTarget.IsPassword().ToString());
65 testingTarget.Dispose();
66 tlog.Debug(tag, $"InputMethodOptionsIsPassword END (OK)");
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()
78 tlog.Debug(tag, $"InputMethodOptionsApplyProperty START");
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!");
84 using (PropertyMap settings = new PropertyMap())
86 settings.Add("IsTextPredictionAllowed", new PropertyValue(false));
90 testingTarget.ApplyProperty(settings);
94 tlog.Debug(tag, e.Message.ToString());
95 Assert.Fail("Caught Exception : Failed!");
99 testingTarget.Dispose();
100 tlog.Debug(tag, $"InputMethodOptionsApplyProperty END (OK)");
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()
112 tlog.Debug(tag, $"InputMethodOptionsRetrieveProperty START");
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!");
118 using (PropertyMap settings = new PropertyMap())
120 settings.Add("IsTextPredictionAllowed", new PropertyValue(false));
124 testingTarget.RetrieveProperty(settings);
128 tlog.Debug(tag, e.Message.ToString());
129 Assert.Fail("Caught Exception : Failed!");
133 testingTarget.Dispose();
134 tlog.Debug(tag, $"InputMethodOptionsRetrieveProperty END (OK)");
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()
146 // tlog.Debug(tag, $"InputMethodOptionsCompareAndSet START");
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!");
152 // var result = testingTarget.CompareAndSet(InputMethod.CategoryType.ActionButtonTitle, testingTarget, new SWIGTYPE_p_int(testingTarget.SwigCPtr.Handle));
153 // tlog.Debug(tag, result.ToString());
155 // testingTarget.Dispose();
156 // tlog.Debug(tag, $"InputMethodOptionsCompareAndSet END (OK)");