3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("Internal/Utility/PageFactory")]
13 public class InternalPageFactoryTest
15 private const string tag = "NUITEST";
17 internal class MyPageFactory : PageFactory
19 public MyPageFactory(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
26 tlog.Info(tag, "Init() is called!");
32 tlog.Info(tag, "Destroy() is called!");
37 [Description("PageFactory constructor.")]
38 [Property("SPEC", "Tizen.NUI.PageFactory.PageFactory C")]
39 [Property("SPEC_URL", "-")]
40 [Property("CRITERIA", "CONSTR")]
41 [Property("AUTHOR", "guowei.wang@samsung.com")]
42 public void PageFactoryConstructor()
44 tlog.Debug(tag, $"PageFactoryConstructor START");
46 using (View view = new View())
48 view.Size = new Size(20, 40);
49 view.BackgroundColor = Color.Cyan;
51 var testingTarget = new PageFactory(view.SwigCPtr.Handle, false);
52 Assert.IsNotNull(testingTarget, "Should be not null!");
53 Assert.IsInstanceOf<PageFactory>(testingTarget, "Should be an Instance of PageFactory!");
55 testingTarget.Dispose();
58 tlog.Debug(tag, $"PageFactoryConstructor END (OK)");
63 [Description("PageFactory getCPtr.")]
64 [Property("SPEC", "Tizen.NUI.PageFactory.getCPtr M")]
65 [Property("SPEC_URL", "-")]
66 [Property("CRITERIA", "MR")]
67 [Property("AUTHOR", "guowei.wang@samsung.com")]
68 public void PageFactorygetCPtr()
70 tlog.Debug(tag, $"PageFactorygetCPtr START");
72 using (View view = new View())
74 view.Size = new Size(20, 40);
75 view.BackgroundColor = Color.Cyan;
77 var testingTarget = new MyPageFactory(view.SwigCPtr.Handle, false);
78 Assert.IsNotNull(testingTarget, "Should be not null!");
79 Assert.IsInstanceOf<PageFactory>(testingTarget, "Should be an Instance of PageFactory!");
83 MyPageFactory.getCPtr(testingTarget);
87 tlog.Debug(tag, e.Message.ToString());
88 Assert.Fail("Caught Exception: Failed!");
91 testingTarget.Dispose();
94 tlog.Debug(tag, $"PageFactorygetCPtr END (OK)");