[NUI] Add TCs for NUI.Components.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Components.Devel.Tests / testcase / Controls / TSTabView.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI;
5 using Tizen.NUI.Components;
6 using Tizen.NUI.BaseComponents;
7
8 namespace Tizen.NUI.Components.Devel.Tests
9 {
10     using tlog = Tizen.Log;
11
12     [TestFixture]
13     [Description("Controls/TabView")]
14     public class TabViewTest
15     {
16         private const string tag = "NUITEST";
17
18         internal class MyTabView : TabView
19         {
20             public MyTabView() : base()
21             { }
22
23             public void OnDispose(DisposeTypes types)
24             {
25                 base.Dispose(types);
26             }
27         }
28
29         [SetUp]
30         public void Init()
31         {
32             tlog.Info(tag, "Init() is called!");
33         }
34
35         [TearDown]
36         public void Destroy()
37         {
38             tlog.Info(tag, "Destroy() is called!");
39         }
40
41         [Test]
42         [Category("P1")]
43         [Description("TabView Dispose.")]
44         [Property("SPEC", "Tizen.NUI.Components.TabView.Dispose M")]
45         [Property("SPEC_URL", "-")]
46         [Property("CRITERIA", "MR")]
47         [Property("COVPARAM", "")]
48         [Property("AUTHOR", "guowei.wang@samsung.com")]
49         public void TabViewDispose()
50         {
51             tlog.Debug(tag, $"TabViewDispose START");
52
53             var testingTarget = new MyTabView();
54             Assert.IsNotNull(testingTarget, "null handle");
55             Assert.IsInstanceOf<TabView>(testingTarget, "Should return TabView instance.");
56
57             try
58             {
59                 testingTarget.OnDispose(DisposeTypes.Explicit);
60             }
61             catch (Exception e)
62             {
63                 tlog.Debug(tag, e.Message.ToString());
64                 Assert.Fail("Caught Exception : Failed!");
65             }
66
67             testingTarget.Dispose();
68             tlog.Debug(tag, $"TabViewDispose END (OK)");
69         }
70     }
71 }