Merge remote-tracking branch 'origin/master' into tizen
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Utility / TSCreateWidgetFunction.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/CreateWidgetFunction")]
13     public class InternalCreateWidgetFunctionTest
14     {
15         private const string tag = "NUITEST";
16
17         internal class MyCreateWidgetFunction : CreateWidgetFunction
18         {
19             public MyCreateWidgetFunction() : base()
20             { }
21
22         }
23
24         [SetUp]
25         public void Init()
26         {
27             tlog.Info(tag, "Init() is called!");
28         }
29
30         [TearDown]
31         public void Destroy()
32         {
33             tlog.Info(tag, "Destroy() is called!");
34         }
35
36         [Test]
37         [Category("P1")]
38         [Description("CreateWidgetFunction constructor.")]
39         [Property("SPEC", "Tizen.NUI.CreateWidgetFunction.CreateWidgetFunction C")]
40         [Property("SPEC_URL", "-")]
41         [Property("CRITERIA", "CONSTR")]
42         [Property("AUTHOR", "guowei.wang@samsung.com")]
43         public void CreateWidgetFunctionConstructor()
44         {
45             tlog.Debug(tag, $"CreateWidgetFunctionConstructor START");
46
47             var testingTarget = new MyCreateWidgetFunction();
48             Assert.IsNotNull(testingTarget, "Should be not null!");
49             Assert.IsInstanceOf<CreateWidgetFunction>(testingTarget, "Should be an Instance of CreateWidgetFunction!");
50
51             tlog.Debug(tag, $"CreateWidgetFunctionConstructor END (OK)");
52         }
53
54         [Test]
55         [Category("P1")]
56         [Description("CreateWidgetFunction constructor. With IntPtr.")]
57         [Property("SPEC", "Tizen.NUI.CreateWidgetFunction.CreateWidgetFunction C")]
58         [Property("SPEC_URL", "-")]
59         [Property("CRITERIA", "CONSTR")]
60         [Property("AUTHOR", "guowei.wang@samsung.com")]
61         public void CreateWidgetFunctionConstructorWithIntPtr()
62         {
63             tlog.Debug(tag, $"CreateWidgetFunctionConstructorWithIntPtr START");
64
65             using (View view = new View())
66             {
67                 var testingTarget = new CreateWidgetFunction(view.SwigCPtr.Handle);
68                 Assert.IsNotNull(testingTarget, "Should be not null!");
69                 Assert.IsInstanceOf<CreateWidgetFunction>(testingTarget, "Should be an Instance of CreateWidgetFunction!");
70             }
71
72             tlog.Debug(tag, $"CreateWidgetFunctionConstructorWithIntPtr END (OK)");
73         }
74     }
75 }