[NUI][NUI.Devel] Update line coverage TCs of NUI.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / EXaml / Action / TSRootAction.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 using Tizen.NUI.EXaml;
7
8 namespace Tizen.NUI.Devel.Tests
9 {
10     using tlog = Tizen.Log;
11
12     [TestFixture]
13     [Description("internal/EXaml/Action/RootAction")]
14     public class InternalRootActionTest
15     {
16         private const string tag = "NUITEST";
17
18         internal class MyRootAction : Tizen.NUI.EXaml.Action
19         {
20             public void Init() { }
21
22             public void OnActive() { }
23
24             EXaml.Action EXaml.Action.DealChar(char c)
25             {
26                 return this;
27             }
28         }
29
30         [SetUp]
31         public void Init()
32         {
33             tlog.Info(tag, "Init() is called!");
34         }
35
36         [TearDown]
37         public void Destroy()
38         {
39             tlog.Info(tag, "Destroy() is called!");
40         }
41         
42         [Test]
43         [Category("P1")]
44         [Description("RootAction constructor.")]
45         [Property("SPEC", "Tizen.NUI.EXaml.RootAction.RootAction C")]
46         [Property("SPEC_URL", "-")]
47         [Property("CRITERIA", "CONSTR")]
48         [Property("AUTHOR", "guowei.wang@samsung.com")]
49         public void EXamlRootActionConstructor()
50         {
51             tlog.Debug(tag, $"EXamlRootActionConstructor START");
52
53             var globalDataList = new GlobalDataList();
54
55             var testingTarget = new Tizen.NUI.EXaml.RootAction(globalDataList);
56             Assert.IsNotNull(testingTarget, "Can't create success object RootAction");
57             Assert.IsInstanceOf<Tizen.NUI.EXaml.RootAction>(testingTarget, "Should be an instance of RootAction type.");
58
59             tlog.Debug(tag, $"EXamlRootActionConstructor END (OK)");
60         }
61
62         [Test]
63         [Category("P1")]
64         [Description("RootAction Init.")]
65         [Property("SPEC", "Tizen.NUI.EXaml.RootAction.Init M")]
66         [Property("SPEC_URL", "-")]
67         [Property("CRITERIA", "MR")]
68         [Property("AUTHOR", "guowei.wang@samsung.com")]
69         public void EXamlRootActionInit()
70         {
71             tlog.Debug(tag, $"EXamlRootActionInit START");
72
73             var globalDataList = new GlobalDataList();
74             
75             var testingTarget = new Tizen.NUI.EXaml.RootAction(globalDataList);
76             Assert.IsNotNull(testingTarget, "Can't create success object RootAction");
77             Assert.IsInstanceOf<Tizen.NUI.EXaml.RootAction>(testingTarget, "Should be an instance of RootAction type.");
78
79             try
80             {
81                 testingTarget.Init();
82             }
83             catch (Exception e)
84             {
85                 tlog.Debug(tag, e.Message.ToString());
86                 Assert.Fail("Caught Exception : Failed!");
87             }
88
89             tlog.Debug(tag, $"EXamlRootActionInit END (OK)");
90         }
91         
92         [Test]
93         [Category("P1")]
94         [Description("RootAction DealChar.")]
95         [Property("SPEC", "Tizen.NUI.EXaml.RootAction.DealChar M")]
96         [Property("SPEC_URL", "-")]
97         [Property("CRITERIA", "MR")]
98         [Property("AUTHOR", "guowei.wang@samsung.com")]
99         public void EXamlRootActionDealChar()
100         {
101             tlog.Debug(tag, $"EXamlRootActionDealChar START");
102
103             var globalDataList = new GlobalDataList();
104
105             var testingTarget = new Tizen.NUI.EXaml.RootAction(globalDataList);
106             Assert.IsNotNull(testingTarget, "Can't create success object RootAction");
107             Assert.IsInstanceOf<Tizen.NUI.EXaml.RootAction>(testingTarget, "Should be an instance of RootAction type.");
108
109             try
110             {
111                 testingTarget.DealChar('(');
112             }
113             catch (Exception e)
114             {
115                 tlog.Debug(tag, e.Message.ToString());
116                 Assert.Fail("Caught Exception : Failed!");
117             }
118
119             tlog.Debug(tag, $"EXamlRootActionDealChar END (OK)");
120         }
121     }
122 }