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/Model3dView")]
13 public class InternalModel3dViewTest
15 private const string tag = "NUITEST";
16 private string objUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
17 private string mtlUrl = "https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=bmp%E4%B8%8B%E8%BD%BD%20%E4%BD%8D%E5%9B%BE&step_word=&hs=2&pn=0&spn=0&di=30360&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=2&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=-1&cs=506847219%2C2820013657&os=4205693751%2C1065126395&simid=0%2C0&adpicid=0&lpn=0&ln=389&fr=&fmq=1389861203899_R&fm=&ic=0&s=undefined&hd=undefined&latest=undefined©right=undefined&se=&sme=&tab=0&width=&height=&face=undefined&ist=&jit=&cg=&bdtype=0&oriquery=bmp%E4%B8%8B%E8%BD%BD&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%3A%2F%2Fbpic.ooopic.com%2F17%2F52%2F38%2F17523837-6a28a5a38920964a54ed89d8e93c3a3c-0.jpg%26refer%3Dhttp%3A%2F%2Fbpic.ooopic.com%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Djpeg%3Fsec%3D1624445232%26t%3Db9e3c91e4753f12d81e73c7142181326&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3B555rtv_z%26e3Bv54AzdH3Ffij3ty7wgf7AzdH3F80cdnbn0_z%26e3Bip4s&gsm=1&rpstart=0&rpnum=0&islist=&querylist=&force=undefined";
18 private string imageUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
23 tlog.Info(tag, "Init() is called!");
29 tlog.Info(tag, "Destroy() is called!");
34 [Description("Model3dView constructor.")]
35 [Property("SPEC", "Tizen.NUI.Model3dView.Model3dView C")]
36 [Property("SPEC_URL", "-")]
37 [Property("CRITERIA", "CONSTR")]
38 [Property("AUTHOR", "guowei.wang@samsung.com")]
39 public void Model3dViewConstructor()
41 tlog.Debug(tag, $"Model3dViewConstructor START");
43 var testingTarget = new Model3dView();
44 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
45 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
47 testingTarget.Dispose();
49 tlog.Debug(tag, $"Model3dViewConstructor END (OK)");
54 [Description("Model3dView constructor.")]
55 [Property("SPEC", "Tizen.NUI.Model3dView.Model3dView C")]
56 [Property("SPEC_URL", "-")]
57 [Property("CRITERIA", "CONSTR")]
58 [Property("AUTHOR", "guowei.wang@samsung.com")]
59 public void Model3dViewConstructorWith3Urls()
61 tlog.Debug(tag, $"Model3dViewConstructorWith3Urls START");
63 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
64 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
65 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
67 testingTarget.Dispose();
69 tlog.Debug(tag, $"Model3dViewConstructorWith3Urls END (OK)");
74 [Description("Model3dView constructor.")]
75 [Property("SPEC", "Tizen.NUI.Model3dView.Model3dView C")]
76 [Property("SPEC_URL", "-")]
77 [Property("CRITERIA", "CONSTR")]
78 [Property("AUTHOR", "guowei.wang@samsung.com")]
79 public void Model3dViewConstructorWithModel3dView()
81 tlog.Debug(tag, $"Model3dViewConstructorWithModel3dView START");
83 using (Model3dView view = new Model3dView(objUrl, mtlUrl, imageUrl))
85 var testingTarget = new Model3dView(view);
86 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
87 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
89 testingTarget.Dispose();
92 tlog.Debug(tag, $"Model3dViewConstructorWithModel3dView END (OK)");
97 [Description("Model3dView Assign.")]
98 [Property("SPEC", "Tizen.NUI.Model3dView.Assign M")]
99 [Property("SPEC_URL", "-")]
100 [Property("CRITERIA", "MR")]
101 [Property("AUTHOR", "guowei.wang@samsung.com")]
102 public void Model3dViewAssign()
104 tlog.Debug(tag, $"Model3dViewAssign START");
106 using (Model3dView view = new Model3dView(objUrl, mtlUrl, imageUrl))
108 var testingTarget = view.Assign(view);
109 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
110 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
112 testingTarget.Dispose();
115 tlog.Debug(tag, $"Model3dViewAssign END (OK)");
120 [Description("Model3dView DownCast.")]
121 [Property("SPEC", "Tizen.NUI.Model3dView.DownCast M")]
122 [Property("SPEC_URL", "-")]
123 [Property("CRITERIA", "MR")]
124 [Property("AUTHOR", "guowei.wang@samsung.com")]
125 public void Model3dViewDownCast()
127 tlog.Debug(tag, $"Model3dViewDownCast START");
129 using (Model3dView view = new Model3dView(objUrl, mtlUrl, imageUrl))
131 var testingTarget = Model3dView.DownCast(view);
132 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
133 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
135 testingTarget.Dispose();
138 tlog.Debug(tag, $"Model3dViewDownCast END (OK)");
143 [Description("Model3dView ImagesUrl.")]
144 [Property("SPEC", "Tizen.NUI.Model3dView.ImagesUrl A")]
145 [Property("SPEC_URL", "-")]
146 [Property("CRITERIA", "PRW")]
147 [Property("AUTHOR", "guowei.wang@samsung.com")]
148 public void Model3dViewImagesUrl()
150 tlog.Debug(tag, $"Model3dViewImagesUrl START");
152 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
153 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
154 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
156 tlog.Debug(tag, testingTarget.ImagesUrl);
157 testingTarget.ImagesUrl = mtlUrl;
158 tlog.Debug(tag, testingTarget.ImagesUrl);
160 testingTarget.Dispose();
161 tlog.Debug(tag, $"Model3dViewImagesUrl END (OK)");
166 [Description("Model3dView GeometryUrl.")]
167 [Property("SPEC", "Tizen.NUI.Model3dView.GeometryUrl A")]
168 [Property("SPEC_URL", "-")]
169 [Property("CRITERIA", "PRW")]
170 [Property("AUTHOR", "guowei.wang@samsung.com")]
171 public void Model3dViewGeometryUrl()
173 tlog.Debug(tag, $"Model3dViewGeometryUrl START");
175 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
176 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
177 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
179 tlog.Debug(tag, testingTarget.GeometryUrl);
180 testingTarget.GeometryUrl = mtlUrl;
181 tlog.Debug(tag, testingTarget.GeometryUrl);
183 testingTarget.Dispose();
184 tlog.Debug(tag, $"Model3dViewGeometryUrl END (OK)");
189 [Description("Model3dView MaterialUrl.")]
190 [Property("SPEC", "Tizen.NUI.Model3dView.MaterialUrl A")]
191 [Property("SPEC_URL", "-")]
192 [Property("CRITERIA", "PRW")]
193 [Property("AUTHOR", "guowei.wang@samsung.com")]
194 public void Model3dViewMaterialUrl()
196 tlog.Debug(tag, $"Model3dViewMaterialUrl START");
198 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
199 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
200 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
202 tlog.Debug(tag, testingTarget.MaterialUrl);
203 testingTarget.MaterialUrl = mtlUrl;
204 tlog.Debug(tag, testingTarget.MaterialUrl);
206 testingTarget.Dispose();
207 tlog.Debug(tag, $"Model3dViewMaterialUrl END (OK)");
212 [Description("Model3dView IlluminationType.")]
213 [Property("SPEC", "Tizen.NUI.Model3dView.IlluminationType A")]
214 [Property("SPEC_URL", "-")]
215 [Property("CRITERIA", "PRW")]
216 [Property("AUTHOR", "guowei.wang@samsung.com")]
217 public void Model3dViewIlluminationType()
219 tlog.Debug(tag, $"Model3dViewIlluminationType START");
221 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
222 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
223 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
225 tlog.Debug(tag, testingTarget.IlluminationType.ToString());
226 testingTarget.IlluminationType = 2;
227 tlog.Debug(tag, testingTarget.IlluminationType.ToString());
229 testingTarget.Dispose();
230 tlog.Debug(tag, $"Model3dViewIlluminationType END (OK)");
235 [Description("Model3dView Texture0Url.")]
236 [Property("SPEC", "Tizen.NUI.Model3dView.Texture0Url A")]
237 [Property("SPEC_URL", "-")]
238 [Property("CRITERIA", "PRW")]
239 [Property("AUTHOR", "guowei.wang@samsung.com")]
240 public void Model3dViewTexture0Url()
242 tlog.Debug(tag, $"Model3dViewTexture0Url START");
244 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
245 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
246 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
248 tlog.Debug(tag, testingTarget.Texture0Url);
249 testingTarget.Texture0Url = imageUrl;
250 tlog.Debug(tag, testingTarget.Texture0Url);
252 testingTarget.Dispose();
253 tlog.Debug(tag, $"Model3dViewTexture0Url END (OK)");
258 [Description("Model3dView Texture1Url.")]
259 [Property("SPEC", "Tizen.NUI.Model3dView.Texture1Url A")]
260 [Property("SPEC_URL", "-")]
261 [Property("CRITERIA", "PRW")]
262 [Property("AUTHOR", "guowei.wang@samsung.com")]
263 public void Model3dViewTexture1Url()
265 tlog.Debug(tag, $"Model3dViewTexture1Url START");
267 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
268 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
269 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
271 tlog.Debug(tag, testingTarget.Texture1Url);
272 testingTarget.Texture1Url = objUrl;
273 tlog.Debug(tag, testingTarget.Texture1Url);
275 testingTarget.Dispose();
276 tlog.Debug(tag, $"Model3dViewTexture1Url END (OK)");
281 [Description("Model3dView Texture2Url.")]
282 [Property("SPEC", "Tizen.NUI.Model3dView.Texture2Url A")]
283 [Property("SPEC_URL", "-")]
284 [Property("CRITERIA", "PRW")]
285 [Property("AUTHOR", "guowei.wang@samsung.com")]
286 public void Model3dViewTexture2Url()
288 tlog.Debug(tag, $"Model3dViewTexture2Url START");
290 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
291 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
292 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
294 tlog.Debug(tag, testingTarget.Texture2Url);
295 testingTarget.Texture2Url = mtlUrl;
296 tlog.Debug(tag, testingTarget.Texture2Url);
298 testingTarget.Dispose();
299 tlog.Debug(tag, $"Model3dViewTexture2Url END (OK)");
304 [Description("Model3dView LightPosition.")]
305 [Property("SPEC", "Tizen.NUI.Model3dView.LightPosition A")]
306 [Property("SPEC_URL", "-")]
307 [Property("CRITERIA", "PRW")]
308 [Property("AUTHOR", "guowei.wang@samsung.com")]
309 public void Model3dViewLightPosition()
311 tlog.Debug(tag, $"Model3dViewLightPosition START");
313 var testingTarget = new Model3dView(objUrl, mtlUrl, imageUrl);
314 Assert.IsNotNull(testingTarget, "Can't create success object Model3dView");
315 Assert.IsInstanceOf<Model3dView>(testingTarget, "Should be an instance of Model3dView type.");
317 tlog.Debug(tag, testingTarget.LightPosition.ToString());
318 testingTarget.LightPosition = new Vector3(0.3f, 0.1f, 0.8f);
319 tlog.Debug(tag, testingTarget.LightPosition.ToString());
321 testingTarget.Dispose();
322 tlog.Debug(tag, $"Model3dViewLightPosition END (OK)");