[NUI] Fix failed TCs of NUI.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Input / TSKey.cs
1 using NUnit.Framework;
2 using NUnit.Framework.TUnit;
3 using System;
4 using Tizen.NUI;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("public/Input/Key")]
13     internal class PublicKeyTest
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("Create a Key object.")]
32         [Property("SPEC", "Tizen.NUI.Key.Key C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("COVPARAM", "")]
36         [Property("AUTHOR", "guowei.wang@samsung.com")]
37         public void KeyConstructor()
38         {
39             tlog.Debug(tag, $"KeyConstructor START");
40             Key a1 = new Key("keyName", "keyString", 97, 90, 100000, Key.StateType.Down);
41             a1.Dispose();
42             tlog.Debug(tag, $"KeyConstructor END (OK)");
43             Assert.Pass("KeyConstructor");
44         }
45
46         [Test]
47         [Category("P1")]
48         [Description("Key LogicalKey")]
49         [Property("SPEC", "Tizen.NUI.Key.LogicalKey A")]
50         [Property("SPEC_URL", "-")]
51         [Property("CRITERIA", "PRW")]
52         [Property("AUTHOR", "guowei.wang@samsung.com")]
53         public void KeyLogicalKey()
54         {
55             tlog.Debug(tag, $"KeyLogicalKey START");
56             Key a1 = new Key();
57             string b1 = a1.LogicalKey;
58             a1.Dispose();
59             tlog.Debug(tag, $"KeyLogicalKey END (OK)");
60             Assert.Pass("KeyLogicalKey");
61         }
62
63         [Test]
64         [Category("P1")]
65         [Description("Key KeyPressed")]
66         [Property("SPEC", "Tizen.NUI.Key.KeyPressed A")]
67         [Property("SPEC_URL", "-")]
68         [Property("CRITERIA", "PRW")]
69         [Property("AUTHOR", "guowei.wang@samsung.com")]
70         public void KeyKeyPressed()
71         {
72             tlog.Debug(tag, $"KeyKeyPressed START");
73             Key a1 = new Key();
74             string b1 = a1.KeyPressed;
75             a1.Dispose();
76             tlog.Debug(tag, $"KeyKeyPressed END (OK)");
77             Assert.Pass("KeyKeyPressed");
78         }
79
80         [Test]
81         [Category("P1")]
82         [Description("Key KeyString")]
83         [Property("SPEC", "Tizen.NUI.Key.KeyString A")]
84         [Property("SPEC_URL", "-")]
85         [Property("CRITERIA", "PRW")]
86         [Property("AUTHOR", "guowei.wang@samsung.com")]
87         public void KeyKeyString()
88         {
89             tlog.Debug(tag, $"KeyKeyString START");
90             Key a1 = new Key();
91             string b1 = a1.KeyString;
92             a1.Dispose();
93             tlog.Debug(tag, $"KeyKeyString END (OK)");
94             Assert.Pass("KeyKeyString");
95         }
96
97         [Test]
98         [Category("P1")]
99         [Description("Key KeyModifier")]
100         [Property("SPEC", "Tizen.NUI.Key.KeyModifier A")]
101         [Property("SPEC_URL", "-")]
102         [Property("CRITERIA", "PRW")]
103         [Property("AUTHOR", "guowei.wang@samsung.com")]
104         public void KeyKeyModifier()
105         {
106             tlog.Debug(tag, $"KeyKeyModifier START");
107             Key a1 = new Key();
108             int b1 = a1.KeyModifier;
109             a1.Dispose();
110             tlog.Debug(tag, $"KeyKeyModifier END (OK)");
111             Assert.Pass("KeyKeyModifier");
112         }
113
114         [Test]
115         [Category("P1")]
116         [Description("Key Time")]
117         [Property("SPEC", "Tizen.NUI.Key.Time A")]
118         [Property("SPEC_URL", "-")]
119         [Property("CRITERIA", "PRW")]
120         [Property("AUTHOR", "guowei.wang@samsung.com")]
121         public void KeyTime()
122         {
123             tlog.Debug(tag, $"KeyTime START");
124             Key a1 = new Key
125             {
126                 Time = 1000
127             };
128
129             a1.Dispose();
130             tlog.Debug(tag, $"KeyTime END (OK)");
131             Assert.Pass("KeyTime");
132         }
133
134         [Test]
135         [Category("P1")]
136         [Description("Key GetKeyFromPtr")]
137         [Property("SPEC", "Tizen.NUI.Key.GetKeyFromPtr M")]
138         [Property("SPEC_URL", "-")]
139         [Property("CRITERIA", "MR")]
140         [Property("AUTHOR", "guowei.wang@samsung.com")]
141         public void KeyGetKeyFromPtr()
142         {
143             tlog.Debug(tag, $"KeyGetKeyFromPtr START");
144             Key a1 = new Key();
145
146             Key b1 = Key.GetKeyFromPtr(a1.SwigCPtr.Handle);
147
148             b1.Dispose();
149             a1.Dispose();
150             tlog.Debug(tag, $"KeyGetKeyFromPtr END (OK)");
151             Assert.Pass("KeyGetKeyFromPtr");
152         }
153     }
154
155 }