Merge remote-tracking branch 'origin/master' into tizen
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Utility / TSItemFactory.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/Utility/ItemFactory")]
13     public class InternalItemFactoryTest
14     {
15         private const string tag = "NUITEST";
16
17         internal class MyItemFactory : ItemFactory
18         {
19             public MyItemFactory() : base()
20             { }
21         }
22
23         [SetUp]
24         public void Init()
25         {
26             tlog.Info(tag, "Init() is called!");
27         }
28
29         [TearDown]
30         public void Destroy()
31         {
32             tlog.Info(tag, "Destroy() is called!");
33         }
34
35         [Test]
36         [Category("P1")]
37         [Description("ItemFactory constructor.")]
38         [Property("SPEC", "Tizen.NUI.ItemFactory.ItemFactory C")]
39         [Property("SPEC_URL", "-")]
40         [Property("CRITERIA", "CONSTR")]
41         [Property("AUTHOR", "guowei.wang@samsung.com")]
42         public void ItemFactoryConstructor()
43         {
44             tlog.Debug(tag, $"ItemFactoryConstructor START");
45
46             var testingTarget = new ItemFactory();
47             Assert.IsNotNull(testingTarget, "Should be not null!");
48             Assert.IsInstanceOf<ItemFactory>(testingTarget, "Should be an Instance of ItemFactory!");
49
50             testingTarget.Dispose();
51
52             tlog.Debug(tag, $"ItemFactoryConstructor END (OK)");
53         }
54
55         [Test]
56         [Category("P1")]
57         [Description("ItemFactory getCPtr.")]
58         [Property("SPEC", "Tizen.NUI.ItemFactory.getCPtr M")]
59         [Property("SPEC_URL", "-")]
60         [Property("CRITERIA", "MR")]
61         [Property("AUTHOR", "guowei.wang@samsung.com")]
62         public void ItemFactorygetCPtr()
63         {
64             tlog.Debug(tag, $"ItemFactorygetCPtr START");
65
66             var testingTarget = new ItemFactory();
67             Assert.IsNotNull(testingTarget, "Should be not null!");
68             Assert.IsInstanceOf<ItemFactory>(testingTarget, "Should be an Instance of ItemFactory!");
69
70             try
71             {
72                 ItemFactory.getCPtr(testingTarget);
73             }
74             catch (Exception e)
75             {
76                 tlog.Debug(tag, e.Message.ToString());
77                 Assert.Fail("Caught Exception: Failed!");
78             }
79
80             testingTarget.Dispose();
81
82             tlog.Debug(tag, $"ItemFactorygetCPtr END (OK)");
83         }
84
85
86     }
87 }