[NUI] Add TCs related signal in Common(internal).
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSCustomAlgorithmInterface.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/CustomAlgorithmInterface")]
13     public class InternalCustomAlgorithmInterfaceTest
14     {
15         private const string tag = "NUITEST";
16
17         internal class MyCustomAlgorithmInterface : CustomAlgorithmInterface
18         {
19             public MyCustomAlgorithmInterface() : base()
20             { }
21
22             public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
23             {
24                 return base.GetNextFocusableView(current, proposed, direction);
25             }
26         }
27
28         [SetUp]
29         public void Init()
30         {
31             tlog.Info(tag, "Init() is called!");
32         }
33
34         [TearDown]
35         public void Destroy()
36         {
37             tlog.Info(tag, "Destroy() is called!");
38         }
39
40         [Test]
41         [Category("P1")]
42         [Description("CustomAlgorithmInterface constructor.")]
43         [Property("SPEC", "Tizen.NUI.CustomAlgorithmInterface.CustomAlgorithmInterface C")]
44         [Property("SPEC_URL", "-")]
45         [Property("CRITERIA", "CONSTR")]
46         [Property("AUTHOR", "guowei.wang@samsung.com")]
47         public void CustomAlgorithmInterfaceConstructor()
48         {
49             tlog.Debug(tag, $"CustomAlgorithmInterfaceConstructor START");
50
51             var testingTarget = new CustomAlgorithmInterface();
52             Assert.IsNotNull(testingTarget, "Can't create success object CustomAlgorithmInterface");
53             Assert.IsInstanceOf<CustomAlgorithmInterface>(testingTarget, "Should be an instance of CustomAlgorithmInterface type.");
54
55             testingTarget.Dispose();
56
57             tlog.Debug(tag, $"CustomAlgorithmInterfaceConstructor END (OK)");
58         }
59
60         [Test]
61         [Category("P1")]
62         [Description("CustomAlgorithmInterface getCPtr.")]
63         [Property("SPEC", "Tizen.NUI.CustomAlgorithmInterface.getCPtr M")]
64         [Property("SPEC_URL", "-")]
65         [Property("CRITERIA", "MR")]
66         [Property("AUTHOR", "guowei.wang@samsung.com")]
67         public void CustomAlgorithmInterfaceGetCPtr()
68         {
69             tlog.Debug(tag, $"CustomAlgorithmInterfaceGetCPtr START");
70
71             var testingTarget = new CustomAlgorithmInterface();
72             Assert.IsNotNull(testingTarget, "Can't create success object CustomAlgorithmInterface");
73             Assert.IsInstanceOf<CustomAlgorithmInterface>(testingTarget, "Should be an instance of CustomAlgorithmInterface type.");
74
75             try
76             {
77                 CustomAlgorithmInterface.getCPtr(testingTarget);
78             }
79             catch (Exception e)
80             {
81                 tlog.Debug(tag, e.Message.ToString());
82                 Assert.Fail("Caught Exception : Failed!");
83             }
84
85             testingTarget.Dispose();
86
87             tlog.Debug(tag, $"CustomAlgorithmInterfaceGetCPtr END (OK)");
88         }
89
90         //[Test]
91         //[Category("P1")]
92         //[Description("CustomAlgorithmInterface GetNextFocusableView.")]
93         //[Property("SPEC", "Tizen.NUI.CustomAlgorithmInterface.GetNextFocusableView M")]
94         //[Property("SPEC_URL", "-")]
95         //[Property("CRITERIA", "MR")]
96         //[Property("AUTHOR", "guowei.wang@samsung.com")]
97         //public void CustomAlgorithmGetNextFocusableView()
98         //{
99         //    tlog.Debug(tag, $"CustomAlgorithmGetNextFocusableView START");
100
101         //    var testingTarget = new MyCustomAlgorithmInterface();
102         //    Assert.IsNotNull(testingTarget, "Can't create success object CustomAlgorithmInterface");
103         //    Assert.IsInstanceOf<CustomAlgorithmInterface>(testingTarget, "Should be an instance of CustomAlgorithmInterface type.");
104
105         //    using (View current = new View())
106         //    {
107         //        current.Size = new Size(2.0f, 4.0f);
108         //        current.Position = new Position(0.0f, 0.0f);
109
110         //        using (View proposed = new View())
111         //        {
112         //            proposed.Size = new Size(3.0f, 4.0f);
113         //            proposed.Position = new Position(0.0f, 4.0f);
114
115         //            try
116         //            {
117         //                testingTarget.GetNextFocusableView(current, proposed, View.FocusDirection.Down);
118         //            }
119         //            catch (Exception e)
120         //            {
121         //                tlog.Debug(tag, e.Message.ToString());
122         //                Assert.Fail("Caught Exception : Failed!");
123         //            }
124         //        }
125         //    }
126
127         //    testingTarget.Dispose();
128         //    tlog.Debug(tag, $"CustomAlgorithmGetNextFocusableView END (OK)");
129         //}
130     }
131 }