[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSModel3dView.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("internal/Common/Model3dView")]
13     public class InternalModel3dViewTest
14     {
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&copyright=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";
19
20         [SetUp]
21         public void Init()
22         {
23             tlog.Info(tag, "Init() is called!");
24         }
25
26         [TearDown]
27         public void Destroy()
28         {
29             tlog.Info(tag, "Destroy() is called!");
30         }
31
32         [Test]
33         [Category("P1")]
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()
40         {
41             tlog.Debug(tag, $"Model3dViewConstructor START");
42
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.");
46
47             testingTarget.Dispose();
48
49             tlog.Debug(tag, $"Model3dViewConstructor END (OK)");
50         }
51
52         [Test]
53         [Category("P1")]
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()
60         {
61             tlog.Debug(tag, $"Model3dViewConstructorWith3Urls START");
62
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.");
66
67             testingTarget.Dispose();
68
69             tlog.Debug(tag, $"Model3dViewConstructorWith3Urls END (OK)");
70         }
71
72         [Test]
73         [Category("P1")]
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()
80         {
81             tlog.Debug(tag, $"Model3dViewConstructorWithModel3dView START");
82
83             using (Model3dView view = new Model3dView(objUrl, mtlUrl, imageUrl))
84             {
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.");
88
89                 testingTarget.Dispose();
90             }
91
92             tlog.Debug(tag, $"Model3dViewConstructorWithModel3dView END (OK)");
93         }
94
95         [Test]
96         [Category("P1")]
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()
103         {
104             tlog.Debug(tag, $"Model3dViewAssign START");
105
106             using (Model3dView view = new Model3dView(objUrl, mtlUrl, imageUrl))
107             {
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.");
111
112                 testingTarget.Dispose();
113             }
114
115             tlog.Debug(tag, $"Model3dViewAssign END (OK)");
116         }
117
118         [Test]
119         [Category("P1")]
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()
126         {
127             tlog.Debug(tag, $"Model3dViewDownCast START");
128
129             using (Model3dView view = new Model3dView(objUrl, mtlUrl, imageUrl))
130             {
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.");
134
135                 testingTarget.Dispose();
136             }
137
138             tlog.Debug(tag, $"Model3dViewDownCast END (OK)");
139         }
140
141         [Test]
142         [Category("P1")]
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()
149         {
150             tlog.Debug(tag, $"Model3dViewImagesUrl START");
151
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.");
155
156             tlog.Debug(tag, testingTarget.ImagesUrl);
157             testingTarget.ImagesUrl = mtlUrl;
158             tlog.Debug(tag, testingTarget.ImagesUrl);
159
160             testingTarget.Dispose();
161             tlog.Debug(tag, $"Model3dViewImagesUrl END (OK)");
162         }
163
164         [Test]
165         [Category("P1")]
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()
172         {
173             tlog.Debug(tag, $"Model3dViewGeometryUrl START");
174
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.");
178
179             tlog.Debug(tag, testingTarget.GeometryUrl);
180             testingTarget.GeometryUrl = mtlUrl;
181             tlog.Debug(tag, testingTarget.GeometryUrl);
182
183             testingTarget.Dispose();
184             tlog.Debug(tag, $"Model3dViewGeometryUrl END (OK)");
185         }
186
187         [Test]
188         [Category("P1")]
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()
195         {
196             tlog.Debug(tag, $"Model3dViewMaterialUrl START");
197
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.");
201
202             tlog.Debug(tag, testingTarget.MaterialUrl);
203             testingTarget.MaterialUrl = mtlUrl;
204             tlog.Debug(tag, testingTarget.MaterialUrl);
205
206             testingTarget.Dispose();
207             tlog.Debug(tag, $"Model3dViewMaterialUrl END (OK)");
208         }
209
210         [Test]
211         [Category("P1")]
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()
218         {
219             tlog.Debug(tag, $"Model3dViewIlluminationType START");
220
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.");
224
225             tlog.Debug(tag, testingTarget.IlluminationType.ToString());
226             testingTarget.IlluminationType = 2;
227             tlog.Debug(tag, testingTarget.IlluminationType.ToString());
228
229             testingTarget.Dispose();
230             tlog.Debug(tag, $"Model3dViewIlluminationType END (OK)");
231         }
232
233         [Test]
234         [Category("P1")]
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()
241         {
242             tlog.Debug(tag, $"Model3dViewTexture0Url START");
243
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.");
247
248             tlog.Debug(tag, testingTarget.Texture0Url);
249             testingTarget.Texture0Url = imageUrl;
250             tlog.Debug(tag, testingTarget.Texture0Url);
251
252             testingTarget.Dispose();
253             tlog.Debug(tag, $"Model3dViewTexture0Url END (OK)");
254         }
255
256         [Test]
257         [Category("P1")]
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()
264         {
265             tlog.Debug(tag, $"Model3dViewTexture1Url START");
266
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.");
270
271             tlog.Debug(tag, testingTarget.Texture1Url);
272             testingTarget.Texture1Url = objUrl;
273             tlog.Debug(tag, testingTarget.Texture1Url);
274
275             testingTarget.Dispose();
276             tlog.Debug(tag, $"Model3dViewTexture1Url END (OK)");
277         }
278
279         [Test]
280         [Category("P1")]
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()
287         {
288             tlog.Debug(tag, $"Model3dViewTexture2Url START");
289
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.");
293
294             tlog.Debug(tag, testingTarget.Texture2Url);
295             testingTarget.Texture2Url = mtlUrl;
296             tlog.Debug(tag, testingTarget.Texture2Url);
297
298             testingTarget.Dispose();
299             tlog.Debug(tag, $"Model3dViewTexture2Url END (OK)");
300         }
301
302         [Test]
303         [Category("P1")]
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()
310         {
311             tlog.Debug(tag, $"Model3dViewLightPosition START");
312
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.");
316
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());
320
321             testingTarget.Dispose();
322             tlog.Debug(tag, $"Model3dViewLightPosition END (OK)");
323         }
324     }
325 }