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