[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 / MarkupExtensions / TSReferenceExtension.cs
1 using NUnit.Framework;
2 using System;
3 using Tizen.NUI.Xaml;
4
5 namespace Tizen.NUI.Devel.Tests
6 {
7     using tlog = Tizen.Log;
8
9     [TestFixture]
10     [Description("public/xaml/MarkupExtensions/ReferenceExtension")]
11     public class PublicReferenceExtensionTest
12     {
13         private const string tag = "NUITEST";
14         private static ReferenceExtension r1;
15
16         internal class IServiceProviderimplement : IServiceProvider
17         {
18             public object GetService(Type serviceType)
19             {
20                 return null;
21             }
22         }
23
24         [SetUp]
25         public void Init()
26         {
27             tlog.Info(tag, "Init() is called!");
28             r1 = new ReferenceExtension();
29         }
30
31         [TearDown]
32         public void Destroy()
33         {
34             r1 = null;
35             tlog.Info(tag, "Destroy() is called!");
36         }
37
38         [Test]
39         [Category("P1")]
40         [Description("ReferenceExtension Name")]
41         [Property("SPEC", "Tizen.NUI.ReferenceExtension.Name A")]
42         [Property("SPEC_URL", "-")]
43         [Property("CRITERIA", "PRW")]
44         public void ReferenceExtensionName()
45         {
46             tlog.Debug(tag, $"ReferenceExtensionName START");
47
48             try
49             {
50                 string tmp = r1.Name;
51                 r1.Name = tmp;
52             }
53             catch (Exception e)
54             {
55                 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
56                 Assert.Fail("Caught Exception" + e.ToString());
57             }
58
59             tlog.Debug(tag, $"ReferenceExtensionName END (OK)");
60             Assert.Pass("ReferenceExtensionName");
61         }
62
63         [Test]
64         [Category("P1")]
65         [Description("ReferenceExtension ProvideValue")]
66         [Property("SPEC", "Tizen.NUI.ReferenceExtension.ProvideValue A")]
67         [Property("SPEC_URL", "-")]
68         [Property("CRITERIA", "PRW")]
69         public void ReferenceExtensionProvideValue()
70         {
71             tlog.Debug(tag, $"ReferenceExtensionProvideValue START");
72
73             try
74             {
75                 IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
76                 r1.ProvideValue(serviceProviderimplement);
77             }
78             catch (Exception e)
79             {
80                 tlog.Debug(tag, e.Message.ToString());
81                 tlog.Debug(tag, $"ReferenceExtensionProvideValue END (OK)");
82                 Assert.Pass("Caught Exception : passed!");
83             }
84         }
85     }
86 }