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/Common/CustomAlgorithmInterface")]
13 public class InternalCustomAlgorithmInterfaceTest
15 private const string tag = "NUITEST";
17 internal class MyCustomAlgorithmInterface : CustomAlgorithmInterface
19 public MyCustomAlgorithmInterface() : base()
22 public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
24 return base.GetNextFocusableView(current, proposed, direction);
31 tlog.Info(tag, "Init() is called!");
37 tlog.Info(tag, "Destroy() is called!");
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()
49 tlog.Debug(tag, $"CustomAlgorithmInterfaceConstructor START");
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.");
55 testingTarget.Dispose();
57 tlog.Debug(tag, $"CustomAlgorithmInterfaceConstructor END (OK)");
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()
69 tlog.Debug(tag, $"CustomAlgorithmInterfaceGetCPtr START");
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.");
77 CustomAlgorithmInterface.getCPtr(testingTarget);
81 tlog.Debug(tag, e.Message.ToString());
82 Assert.Fail("Caught Exception : Failed!");
85 testingTarget.Dispose();
87 tlog.Debug(tag, $"CustomAlgorithmInterfaceGetCPtr END (OK)");
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()
99 // tlog.Debug(tag, $"CustomAlgorithmGetNextFocusableView START");
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.");
105 // using (View current = new View())
107 // current.Size = new Size(2.0f, 4.0f);
108 // current.Position = new Position(0.0f, 0.0f);
110 // using (View proposed = new View())
112 // proposed.Size = new Size(3.0f, 4.0f);
113 // proposed.Position = new Position(0.0f, 4.0f);
117 // testingTarget.GetNextFocusableView(current, proposed, View.FocusDirection.Down);
119 // catch (Exception e)
121 // tlog.Debug(tag, e.Message.ToString());
122 // Assert.Fail("Caught Exception : Failed!");
127 // testingTarget.Dispose();
128 // tlog.Debug(tag, $"CustomAlgorithmGetNextFocusableView END (OK)");