[NUI] Update TCs of NUI.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Xaml / MarkupExtensions / TSStaticExtension.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/StaticExtension")]
11     public class PublicStaticExtensionTest
12     {
13         private const string tag = "NUITEST";
14         private StaticExtension sExtention;
15
16         internal class IServiceProviderImpl : IServiceProvider
17         {
18             public object GetService(Type serviceType) { return null; }
19         }
20
21         [SetUp]
22         public void Init()
23         {
24             tlog.Info(tag, "Init() is called!");
25             sExtention = new StaticExtension();
26         }
27
28         [TearDown]
29         public void Destroy()
30         {
31             sExtention = null;
32             tlog.Info(tag, "Destroy() is called!");
33         }
34
35         [Test]
36         [Category("P1")]
37         [Description("StaticExtension Member")]
38         [Property("SPEC", "Tizen.NUI.StaticExtension.Member A")]
39         [Property("SPEC_URL", "-")]
40         [Property("CRITERIA", "PRW")]
41         public void StaticExtensionMember()
42         {
43             tlog.Debug(tag, $"StaticExtensionMember START");
44
45             try
46             {
47                 var member = sExtention.Member;
48                 sExtention.Member = member;
49                 Assert.AreEqual(member, sExtention.Member, "Should be equal");
50             }
51             catch (Exception e)
52             {
53                 tlog.Debug(tag, e.Message.ToString());
54                 Assert.Fail("Caught Exception : Failed!");
55             }
56
57             tlog.Debug(tag, $"StaticExtensionMember END");
58         }
59
60         [Test]
61         [Category("P1")]
62         [Description("StaticExtension ProvideValue")]
63         [Property("SPEC", "Tizen.NUI.StaticExtension.ProvideValue M")]
64         [Property("SPEC_URL", "-")]
65         [Property("CRITERIA", "MR")]
66         public void StaticExtensionProvideValue()
67         {
68             tlog.Debug(tag, $"StaticExtensionProvideValue START");
69
70             try
71             {
72                 sExtention.ProvideValue(new IServiceProviderImpl());  // IXamlTypeResolver is null
73             }
74             catch (ArgumentException e)
75             {
76                 tlog.Debug(tag, e.Message.ToString());
77                 tlog.Debug(tag, $"StaticExtensionProvideValue END");
78                 Assert.Pass("Caught ArgumentException : Passed!");
79             }
80         }
81     }
82 }