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/AsyncImageLoader")]
13 public class InternalAsyncImageLoaderTest
15 private const string tag = "NUITEST";
16 private string url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("AsyncImageLoader constructor.")]
32 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.AsyncImageLoader C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void AsyncImageLoaderConstructor()
38 tlog.Debug(tag, $"AsyncImageLoaderConstructor START");
40 var testingTarget = new AsyncImageLoader();
41 Assert.IsNotNull(testingTarget, "Can't create success object AsyncImageLoader");
42 Assert.IsInstanceOf<AsyncImageLoader>(testingTarget, "Should be an instance of AsyncImageLoader type.");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"AsyncImageLoaderConstructor END (OK)");
50 [Description("AsyncImageLoader constructor. With AsyncImageLoader.")]
51 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.AsyncImageLoader C")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "CONSTR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void AsyncImageLoaderConstructorWithAsyncImageLoader()
57 tlog.Debug(tag, $"AsyncImageLoaderConstructorWithAsyncImageLoader START");
59 using (AsyncImageLoader loader = new AsyncImageLoader())
61 var testingTarget = new AsyncImageLoader(loader);
62 Assert.IsNotNull(testingTarget, "Can't create success object AsyncImageLoader");
63 Assert.IsInstanceOf<AsyncImageLoader>(testingTarget, "Should be an instance of AsyncImageLoader type.");
65 testingTarget.Dispose();
68 tlog.Debug(tag, $"AsyncImageLoaderConstructorWithAsyncImageLoader END (OK)");
73 [Description("AsyncImageLoader Assign.")]
74 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.Assign M")]
75 [Property("SPEC_URL", "-")]
76 [Property("CRITERIA", "MR")]
77 [Property("AUTHOR", "guowei.wang@samsung.com")]
78 public void AsyncImageLoaderAssign()
80 tlog.Debug(tag, $"AsyncImageLoaderAssign START");
82 using (AsyncImageLoader loader = new AsyncImageLoader())
84 var testingTarget = new AsyncImageLoader(loader);
85 Assert.IsNotNull(testingTarget, "Can't create success object AsyncImageLoader");
86 Assert.IsInstanceOf<AsyncImageLoader>(testingTarget, "Should be an instance of AsyncImageLoader type.");
90 testingTarget.Assign(loader);
94 tlog.Debug(tag, e.Message.ToString());
95 Assert.Fail("Caught Exception: Failed!");
98 testingTarget.Dispose();
101 tlog.Debug(tag, $"AsyncImageLoaderAssign END (OK)");
106 [Description("AsyncImageLoader DownCast.")]
107 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.DownCast M")]
108 [Property("SPEC_URL", "-")]
109 [Property("CRITERIA", "MR")]
110 [Property("AUTHOR", "guowei.wang@samsung.com")]
111 public void AsyncImageLoaderDownCast()
113 tlog.Debug(tag, $"AsyncImageLoaderDownCast START");
115 using (AsyncImageLoader loader = new AsyncImageLoader())
119 AsyncImageLoader.DownCast(loader);
123 tlog.Debug(tag, e.Message.ToString());
124 Assert.Fail("Caught Exception: Failed!");
128 tlog.Debug(tag, $"AsyncImageLoaderDownCast END (OK)");
133 [Description("AsyncImageLoader Load.")]
134 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.Load M")]
135 [Property("SPEC_URL", "-")]
136 [Property("CRITERIA", "MR")]
137 [Property("AUTHOR", "guowei.wang@samsung.com")]
138 public void AsyncImageLoaderLoad()
140 tlog.Debug(tag, $"AsyncImageLoaderLoad START");
142 using (AsyncImageLoader loader = new AsyncImageLoader())
150 tlog.Debug(tag, e.Message.ToString());
151 Assert.Fail("Caught Exception: Failed!");
155 tlog.Debug(tag, $"AsyncImageLoaderLoad END (OK)");
160 [Description("AsyncImageLoader Load. With dimensions.")]
161 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.Load M")]
162 [Property("SPEC_URL", "-")]
163 [Property("CRITERIA", "MR")]
164 [Property("AUTHOR", "guowei.wang@samsung.com")]
165 public void AsyncImageLoaderLoadWithDimensions()
167 tlog.Debug(tag, $"AsyncImageLoaderLoadWithDimensions START");
169 using (AsyncImageLoader loader = new AsyncImageLoader())
173 loader.Load(url, new Uint16Pair(100, 80));
177 tlog.Debug(tag, e.Message.ToString());
178 Assert.Fail("Caught Exception: Failed!");
182 tlog.Debug(tag, $"AsyncImageLoaderLoadWithDimensions END (OK)");
187 [Description("AsyncImageLoader Load. With fittingMode.")]
188 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.Load M")]
189 [Property("SPEC_URL", "-")]
190 [Property("CRITERIA", "MR")]
191 [Property("AUTHOR", "guowei.wang@samsung.com")]
192 public void AsyncImageLoaderLoadWithFittingMode()
194 tlog.Debug(tag, $"AsyncImageLoaderLoadWithFittingMode START");
196 using (AsyncImageLoader loader = new AsyncImageLoader())
200 loader.Load(url, new Uint16Pair(100, 80), FittingModeType.Center, SamplingModeType.Linear, false);
204 tlog.Debug(tag, e.Message.ToString());
205 Assert.Fail("Caught Exception: Failed!");
209 tlog.Debug(tag, $"AsyncImageLoaderLoadWithFittingMode END (OK)");
214 [Description("AsyncImageLoader Cancel.")]
215 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.Cancel M")]
216 [Property("SPEC_URL", "-")]
217 [Property("CRITERIA", "MR")]
218 [Property("AUTHOR", "guowei.wang@samsung.com")]
219 public void AsyncImageLoaderCancel()
221 tlog.Debug(tag, $"AsyncImageLoaderCancel START");
223 using (AsyncImageLoader loader = new AsyncImageLoader())
227 loader.Load(url, new Uint16Pair(100, 80), FittingModeType.Center, SamplingModeType.Linear, false);
232 tlog.Debug(tag, e.Message.ToString());
233 Assert.Fail("Caught Exception: Failed!");
237 tlog.Debug(tag, $"AsyncImageLoaderCancel END (OK)");
242 [Description("AsyncImageLoader CancelAll.")]
243 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.CancelAll M")]
244 [Property("SPEC_URL", "-")]
245 [Property("CRITERIA", "MR")]
246 [Property("AUTHOR", "guowei.wang@samsung.com")]
247 public void AsyncImageLoaderCancelAll()
249 tlog.Debug(tag, $"AsyncImageLoaderCancelAll START");
251 using (AsyncImageLoader loader = new AsyncImageLoader())
255 loader.Load(url, new Uint16Pair(100, 80), FittingModeType.Center, SamplingModeType.Linear, false);
260 tlog.Debug(tag, e.Message.ToString());
261 Assert.Fail("Caught Exception: Failed!");
265 tlog.Debug(tag, $"AsyncImageLoaderCancelAll END (OK)");
270 [Description("AsyncImageLoader ImageLoadedSignal.")]
271 [Property("SPEC", "Tizen.NUI.AsyncImageLoader.ImageLoadedSignal M")]
272 [Property("SPEC_URL", "-")]
273 [Property("CRITERIA", "MR")]
274 [Property("AUTHOR", "guowei.wang@samsung.com")]
275 public void AsyncImageLoaderImageLoadedSignal()
277 tlog.Debug(tag, $"AsyncImageLoaderImageLoadedSignal START");
279 using (AsyncImageLoader loader = new AsyncImageLoader())
283 loader.ImageLoadedSignal();
287 tlog.Debug(tag, e.Message.ToString());
288 Assert.Fail("Caught Exception: Failed!");
292 tlog.Debug(tag, $"AsyncImageLoaderImageLoadedSignal END (OK)");