3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
7 using System.Runtime.InteropServices;
9 namespace Tizen.NUI.Devel.Tests
11 using tlog = Tizen.Log;
14 [Description("public/Common/FrameUpdateCallbackInterface")]
15 class PublicFrameUpdateCallbackInterfaceTest
17 private const string tag = "NUITEST";
19 internal class MyFrameUpdateCallbackInterface : FrameUpdateCallbackInterface
21 public MyFrameUpdateCallbackInterface() : base()
24 public View view = new View()
26 Size = new Size(100, 150, 40),
27 Position = new Position(20, 40),
31 public override void OnUpdate(float elapsedSeconds)
33 base.GetPosition(view.ID, new Position(100.0f, 150.0f, 0.0f));
34 base.SetPosition(view.ID, new Position(100.0f, 150.0f, 0.0f));
35 base.BakePosition(view.ID, new Position(100.0f, 150.0f, 0.0f));
36 base.GetSize(view.ID, new Size(100.0f, 150.0f, 0.0f));
37 base.SetSize(view.ID, new Size(100.0f, 150.0f, 0.0f));
38 base.BakeSize(view.ID, new Size(100.0f, 150.0f, 0.0f));
39 base.GetScale(view.ID, new Vector3(100.0f, 150.0f, 0.0f));
40 base.SetScale(view.ID, new Vector3(100.0f, 150.0f, 0.0f));
41 base.BakeScale(view.ID, new Vector3(100.0f, 150.0f, 0.0f));
42 base.GetColor(view.ID, new Color(100.0f, 150.0f, 0.0f, 200.0f));
43 base.SetColor(view.ID, new Color(100.0f, 150.0f, 0.0f, 200.0f));
44 base.BakeColor(view.ID, new Color(100.0f, 150.0f, 0.0f, 200.0f));
45 base.GetPositionAndSize(view.ID, new Position(100.0f, 150.0f, 0.0f), new Size(100.0f, 200.0f, 300.0f));
53 tlog.Info(tag, "Init() is called!");
59 tlog.Info(tag, "Destroy() is called!");
64 [Description("FrameUpdateCallbackInterface constructor.")]
65 [Property("SPEC", "Tizen.NUI.FrameUpdateCallbackInterface.FrameUpdateCallbackInterface C")]
66 [Property("SPEC_URL", "-")]
67 [Property("CRITERIA", "CONSTR")]
68 [Property("AUTHOR", "guowei.wang@samsung.com")]
69 public void FrameUpdateCallbackInterfaceConstructor()
71 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceConstructor START");
73 var testingTarget = new FrameUpdateCallbackInterface();
74 Assert.IsNotNull(testingTarget, "Can't create success object FrameUpdateCallbackInterface");
75 Assert.IsInstanceOf<FrameUpdateCallbackInterface>(testingTarget, "Should return FrameUpdateCallbackInterface instance.");
77 testingTarget.Dispose();
78 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceConstructor END (OK)");
83 [Description("FrameUpdateCallbackInterface getCPtr.")]
84 [Property("SPEC", "Tizen.NUI.FrameUpdateCallbackInterface.getCPtr C")]
85 [Property("SPEC_URL", "-")]
86 [Property("CRITERIA", "CONSTR")]
87 [Property("AUTHOR", "guowei.wang@samsung.com")]
88 public void FrameUpdateCallbackInterfaceGetCPtr()
90 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceGetCPtr START");
92 var testingTarget = new FrameUpdateCallbackInterface();
93 Assert.IsNotNull(testingTarget, "Can't create success object FrameUpdateCallbackInterface");
94 Assert.IsInstanceOf<FrameUpdateCallbackInterface>(testingTarget, "Should return FrameUpdateCallbackInterface instance.");
96 tlog.Debug(tag, "getCPtr : " + FrameUpdateCallbackInterface.getCPtr(testingTarget));
98 testingTarget.Dispose();
99 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceGetCPtr END (OK)");
104 [Description("FrameUpdateCallbackInterface OnUpdate.")]
105 [Property("SPEC", "Tizen.NUI.FrameUpdateCallbackInterface.OnUpdate M")]
106 [Property("SPEC_URL", "-")]
107 [Property("CRITERIA", "MR")]
108 [Property("AUTHOR", "guowei.wang@samsung.com")]
109 public void FrameUpdateCallbackInterfaceOnUpdate()
111 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceOnUpdate START");
113 var testingTarget = new MyFrameUpdateCallbackInterface();
114 Assert.IsNotNull(testingTarget, "Can't create success object FrameUpdateCallbackInterface");
115 Assert.IsInstanceOf<FrameUpdateCallbackInterface>(testingTarget, "Should return FrameUpdateCallbackInterface instance.");
119 testingTarget.OnUpdate(300);
123 tlog.Debug(tag, e.Message.ToString());
124 Assert.Fail("Caught Exception : Failed!");
127 testingTarget.Dispose();
128 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceOnUpdate END (OK)");
133 [Description("FrameUpdateCallbackInterface AddFrameUpdateCallback.")]
134 [Property("SPEC", "Tizen.NUI.FrameUpdateCallbackInterface.AddFrameUpdateCallback M")]
135 [Property("SPEC_URL", "-")]
136 [Property("CRITERIA", "MR")]
137 [Property("AUTHOR", "guowei.wang@samsung.com")]
138 public void FrameUpdateCallbackInterfaceAddFrameUpdateCallback()
140 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceAddFrameUpdateCallback START");
142 var testingTarget = new MyFrameUpdateCallbackInterface();
143 Assert.IsNotNull(testingTarget, "Can't create success object FrameUpdateCallbackInterface");
144 Assert.IsInstanceOf<FrameUpdateCallbackInterface>(testingTarget, "Should return FrameUpdateCallbackInterface instance.");
148 NUIApplication.GetDefaultWindow().AddFrameUpdateCallback(testingTarget);
149 NUIApplication.GetDefaultWindow().RemoveFrameUpdateCallback(testingTarget);
153 Assert.Fail("Caught Exception" + e.ToString());
156 testingTarget.Dispose();
157 tlog.Debug(tag, $"FrameUpdateCallbackInterfaceAddFrameUpdateCallback END (OK)");