[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Xaml / TSViewExtensions.cs
1 using NUnit.Framework;
2 using System;
3
4 namespace Tizen.NUI.Devel.Tests
5 {
6     using tlog = Tizen.Log;
7
8     [TestFixture]
9     [Description("public/xaml/ViewExtensions")]
10
11     public class PublicViewExtensionsTest
12     {
13         private const string tag = "NUITEST";
14         private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
15         
16         [SetUp]
17         public void Init()
18         {
19             tlog.Info(tag, "Init() is called!");
20         }
21
22         [TearDown]
23         public void Destroy()
24         {
25             tlog.Info(tag, "Destroy() is called!");
26         }
27
28         [Test]
29         [Category("P1")]
30         [Description("Extensions LoadFromXaml")]
31         [Property("SPEC", "Tizen.NUI.Extensions.LoadFromXaml M")]
32         [Property("SPEC_URL", "-")]
33         [Property("CRITERIA", "MR")]
34         [Property("COVPARAM", "string,Type")]
35         public void ExtensionsLoadFromXaml1()
36         {
37             tlog.Debug(tag, $"ExtensionsLoadFromXaml START");
38             try
39             {
40                 Tizen.NUI.Xaml.Extensions.LoadFromXaml<string>("mystring", typeof(string));
41             }
42             catch (Exception e)
43             {
44                 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
45                 Assert.Fail("Caught Exception" + e.ToString());
46             }
47             tlog.Debug(tag, $"ExtensionsLoadFromXaml END (OK)");
48             Assert.Pass("ExtensionsLoadFromXaml");
49         }
50
51         [Test]
52         [Category("P1")]
53         [Description("Extensions LoadFromXaml")]
54         [Property("SPEC", "Tizen.NUI.Extensions.LoadFromXaml M")]
55         [Property("SPEC_URL", "-")]
56         [Property("CRITERIA", "MR")]
57         [Property("COVPARAM", "string,string")]
58         public void ExtensionsLoadFromXaml2()
59         {
60             tlog.Debug(tag, $"ExtensionsLoadFromXaml START");
61             try
62             {
63                 Tizen.NUI.Xaml.Extensions.LoadFromXaml<string>("mystring", "/home/owner/apps_rw/Tizen.NUI.Devel.Tests/tizen-manifest.xml");
64             }
65             catch (Exception e)
66             {
67                 tlog.Debug(tag, e.Message.ToString());
68                 tlog.Debug(tag, $"ExtensionsLoadFromXaml END (OK)");
69                 Assert.Pass("Caught Exception : passed!");
70             }
71         }
72
73         [Test]
74         [Category("P1")]
75         [Description("Extensions LoadObject")]
76         [Property("SPEC", "Tizen.NUI.Extensions.LoadObject M")]
77         [Property("SPEC_URL", "-")]
78         [Property("CRITERIA", "MR")]
79         public void ExtensionsLoadObject()
80         {
81             tlog.Debug(tag, $"ExtensionsLoadObject START");
82
83             try
84             {
85                 Tizen.NUI.Xaml.Extensions.LoadObject<string>(path);
86
87             }
88             catch (Exception e)
89             {
90                 tlog.Debug(tag, e.Message.ToString());
91                 tlog.Debug(tag, $"ExtensionsLoadObject END (OK)");
92                 Assert.Pass("Caught Exception : passed!");
93             }
94         }
95
96         [Test]
97         [Category("P1")]
98         [Description("Extensions LoadFromXamlFile")]
99         [Property("SPEC", "Tizen.NUI.Extensions.LoadFromXamlFile M")]
100         [Property("SPEC_URL", "-")]
101         [Property("CRITERIA", "MR")]
102         public void ExtensionsLoadFromXamlFile()
103         {
104             tlog.Debug(tag, $"ExtensionsLoadFromXamlFile START");
105             try
106             {
107                 Tizen.NUI.Xaml.Extensions.LoadFromXamlFile<string>("myview", "/home/owner/apps_rw/Tizen.NUI.Devel.Tests/tizen-manifest.xml");
108
109             }
110             catch (Exception e)
111             {
112                 tlog.Debug(tag, e.Message.ToString());
113                 tlog.Debug(tag, $"ExtensionsLoadFromXamlFile END (OK)");
114                 Assert.Pass("Caught Exception : passed!");
115             }
116         }
117     }
118 }