[NUI][NUI.Devel] Update TCs of NUI.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSDaliException.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/DaliException")]
13     public class TSDaliException
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("DaliException constructor.")]
32         [Property("SPEC", "Tizen.NUI.DaliException.DaliException C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void DaliExceptionConstructor()
37         {
38             tlog.Debug(tag, $"DaliExceptionConstructor START");
39
40             var testingTarget = new DaliException("China", "Chinese speaking!");
41             Assert.IsNotNull(testingTarget, "Can't create success object DaliException.");
42             Assert.IsInstanceOf<DaliException>(testingTarget, "Should return DaliException instance.");
43
44             testingTarget.Dispose();
45             tlog.Debug(tag, $"DaliExceptionConstructor END (OK)");
46         }
47
48         [Test]
49         [Category("P1")]
50         [Description("DaliException location.")]
51         [Property("SPEC", "Tizen.NUI.DaliException.location A")]
52         [Property("SPEC_URL", "-")]
53         [Property("CRITERIA", "PRW")]
54         [Property("AUTHOR", "guowei.wang@samsung.com")]
55         public void DaliExceptionLocation()
56         {
57             tlog.Debug(tag, $"DaliExceptionLocation START");
58
59             var testingTarget = new DaliException("China", "Chinese speaking!");
60             Assert.IsNotNull(testingTarget, "Can't create success object DaliException.");
61             Assert.IsInstanceOf<DaliException>(testingTarget, "Should return DaliException instance.");
62             
63                         try
64             {
65                 testingTarget.location = "Chinese speaking!";
66                                 tlog.Debug(tag, "location : " + testingTarget.location);
67             }
68             catch (Exception e)
69             {
70                 tlog.Debug(tag, e.Message.ToString());
71                 Assert.Fail("Caught Exception : Failed!");
72             }
73
74             testingTarget.Dispose();
75             tlog.Debug(tag, $"DaliExceptionLocation END (OK)");
76         }
77
78         [Test]
79         [Category("P1")]
80         [Description("DaliException condition.")]
81         [Property("SPEC", "Tizen.NUI.DaliException.DaliException A")]
82         [Property("SPEC_URL", "-")]
83         [Property("CRITERIA", "PRW")]
84         [Property("AUTHOR", "guowei.wang@samsung.com")]
85         public void DaliExceptionCondition()
86         {
87             tlog.Debug(tag, $"DaliExceptionCondition START");
88
89             var testingTarget = new DaliException("China", "Chinese speaking!");
90             Assert.IsNotNull(testingTarget, "Can't create success object DaliException.");
91             Assert.IsInstanceOf<DaliException>(testingTarget, "Should return DaliException instance.");
92
93             testingTarget.condition= "Korea";
94             tlog.Debug(tag, "condition : " + testingTarget.condition);
95
96             testingTarget.Dispose();
97             tlog.Debug(tag, $"DaliExceptionCondition END (OK)");
98         }
99     }
100 }