d1afedf705c7517c91d8b0151b664458b4ab6576
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSCustomActorImpl.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/CustomActorImpl")]
13     public class InternalCustomActorImplTest
14     {
15         private const string tag = "NUITEST";
16         private View actor = null;
17
18         internal class MyCustomActorImpl : CustomActorImpl
19         {
20             public MyCustomActorImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
21             { 
22             }
23         }
24
25         [SetUp]
26         public void Init()
27         {
28             tlog.Info(tag, "Init() is called!");
29             actor = new View() { Size = new Size(100, 200) };
30         }
31
32         [TearDown]
33         public void Destroy()
34         {
35             actor.Dispose();
36             tlog.Info(tag, "Destroy() is called!");
37         }
38
39         [Test]
40         [Category("P1")]
41         [Description("CustomActorImpl constructor.")]
42         [Property("SPEC", "Tizen.NUI.CustomActorImpl.CustomActorImpl C")]
43         [Property("SPEC_URL", "-")]
44         [Property("CRITERIA", "CONSTR")]
45         [Property("AUTHOR", "guowei.wang@samsung.com")]
46         public void CustomActorImplConstructor()
47         {
48             tlog.Debug(tag, $"CustomActorImplConstructor START");
49
50             var testingTarget = new CustomActorImpl(actor.SwigCPtr.Handle, false);
51             Assert.IsNotNull(testingTarget, "Should be not null!");
52             Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
53
54             testingTarget.Dispose();
55             tlog.Debug(tag, $"CustomActorImplConstructor END (OK)");
56         }
57
58         [Test]
59         [Category("P1")]
60         [Description("CustomActorImpl IsRelayoutEnabled.")]
61         [Property("SPEC", "Tizen.NUI.CustomActorImpl.IsRelayoutEnabled M")]
62         [Property("SPEC_URL", "-")]
63         [Property("CRITERIA", "MR")]
64         [Property("AUTHOR", "guowei.wang@samsung.com")]
65         public void CustomActorImplIsRelayoutEnabled()
66         {
67             tlog.Debug(tag, $"CustomActorImplIsRelayoutEnabled START");
68
69             var testingTarget = new CustomActorImpl(actor.SwigCPtr.Handle, false);
70             Assert.IsNotNull(testingTarget, "Should be not null!");
71             Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
72
73             var result = testingTarget.IsRelayoutEnabled();
74             tlog.Debug(tag, "IsRelayoutEnabled : " + result);
75
76             testingTarget.Dispose();
77             tlog.Debug(tag, $"CustomActorImplIsRelayoutEnabled END (OK)");
78         }
79     }
80 }