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/NativeImageInterface")]
13 public class InternalNativeImageInterfaceTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("NativeImageInterface constructor.")]
32 [Property("SPEC", "Tizen.NUI.NativeImageInterface.NativeImageInterface C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void NativeImageInterfaceConstructor()
38 tlog.Debug(tag, $"NativeImageInterfaceConstructor START");
40 var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
41 Assert.IsNotNull(testingTarget, "Should be not null!");
42 Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
44 tlog.Debug(tag, "getCPtr : " + NativeImageInterface.getCPtr(testingTarget));
46 testingTarget.Dispose();
47 tlog.Debug(tag, $"NativeImageInterfaceConstructor END (OK)");
52 [Description("NativeImageInterface TargetTexture.")]
53 [Property("SPEC", "Tizen.NUI.NativeImageInterface.TargetTexture M")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "MR")]
56 [Property("AUTHOR", "guowei.wang@samsung.com")]
57 public void NativeImageInterfaceTargetTexture()
59 tlog.Debug(tag, $"NativeImageInterfaceTargetTexture START");
61 var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
62 Assert.IsNotNull(testingTarget, "Should be not null!");
63 Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
67 testingTarget.TargetTexture();
71 tlog.Debug(tag, e.Message.ToString());
72 Assert.Fail("Caught Exception : Failed!");
75 tlog.Debug(tag, $"NativeImageInterfaceTargetTexture END (OK)");
80 [Description("NativeImageInterface PrepareTexture.")]
81 [Property("SPEC", "Tizen.NUI.NativeImageInterface.PrepareTexture M")]
82 [Property("SPEC_URL", "-")]
83 [Property("CRITERIA", "MR")]
84 [Property("AUTHOR", "guowei.wang@samsung.com")]
85 public void NativeImageInterfacePrepareTexture()
87 tlog.Debug(tag, $"NativeImageInterfacePrepareTexture START");
89 var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
90 Assert.IsNotNull(testingTarget, "Should be not null!");
91 Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
95 testingTarget.PrepareTexture();
99 tlog.Debug(tag, e.Message.ToString());
100 Assert.Fail("Caught Exception : Failed!");
103 tlog.Debug(tag, $"NativeImageInterfacePrepareTexture END (OK)");
108 [Description("NativeImageInterface GetWidth.")]
109 [Property("SPEC", "Tizen.NUI.NativeImageInterface.GetWidth M")]
110 [Property("SPEC_URL", "-")]
111 [Property("CRITERIA", "MR")]
112 [Property("AUTHOR", "guowei.wang@samsung.com")]
113 public void NativeImageInterfaceGetWidth()
115 tlog.Debug(tag, $"NativeImageInterfaceGetWidth START");
117 var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
118 Assert.IsNotNull(testingTarget, "Should be not null!");
119 Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
121 var width = testingTarget.GetWidth();
122 Assert.AreEqual(100, width, "should be equal!");
123 var height = testingTarget.GetHeight();
124 Assert.AreEqual(50, height, "should be equal!");
126 testingTarget.Dispose();
127 tlog.Debug(tag, $"NativeImageInterfaceGetWidth END (OK)");
132 [Description("NativeImageInterface RequiresBlending.")]
133 [Property("SPEC", "Tizen.NUI.NativeImageInterface.RequiresBlending M")]
134 [Property("SPEC_URL", "-")]
135 [Property("CRITERIA", "MR")]
136 [Property("AUTHOR", "guowei.wang@samsung.com")]
137 public void NativeImageInterfaceRequiresBlending()
139 tlog.Debug(tag, $"NativeImageInterfaceRequiresBlending START");
141 var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
142 Assert.IsNotNull(testingTarget, "Should be not null!");
143 Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
145 var result = testingTarget.RequiresBlending();
146 tlog.Debug(tag, "RequiresBlending : " + result);
148 testingTarget.Dispose();
149 tlog.Debug(tag, $"NativeImageInterfaceRequiresBlending END (OK)");