e0aaabb93102e2489ba647d181fd481a7e4a95c8
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Xaml / MarkupExtensions / TSArrayExtension.cs
1 using NUnit.Framework;
2 using System;
3 using System.Collections;
4 using Tizen.NUI.Xaml;
5
6 namespace Tizen.NUI.Devel.Tests
7 {
8     using tlog = Tizen.Log;
9
10     [TestFixture]
11     [Description("public/xaml/MarkupExtensions/ArrayExtension")]
12     public class PublicArrayExtensionTest
13     {
14         private const string tag = "NUITEST";
15         private static ArrayExtension a1;
16
17         internal class IServiceProviderimplement : IServiceProvider
18         {
19             public object GetService(Type serviceType)
20             {
21                 return null;
22             }
23         }
24
25         [SetUp]
26         public void Init()
27         {
28             tlog.Info(tag, "Init() is called!");
29             a1 = new ArrayExtension();
30         }
31
32         [TearDown]
33         public void Destroy()
34         {
35             a1 = null;
36             tlog.Info(tag, "Destroy() is called!");
37         }
38
39         [Test]
40         [Category("P1")]
41         [Description("ArrayExtension ArrayExtension")]
42         [Property("SPEC", "Tizen.NUI.ArrayExtension.ArrayExtension C")]
43         [Property("SPEC_URL", "-")]
44         [Property("CRITERIA", "CONSTR")]
45         public void ArrayExtensionConstructor()
46         {
47             tlog.Debug(tag, $"ArrayExtensionConstructor START");
48
49             ArrayExtension arrayExtension = new ArrayExtension();
50
51             tlog.Debug(tag, $"ArrayExtensionConstructor END (OK)");
52             Assert.Pass("ArrayExtensionConstructor");
53         }
54
55         [Test]
56         [Category("P1")]
57         [Description("ArrayExtension Items")]
58         [Property("SPEC", "Tizen.NUI.ArrayExtension.Items A")]
59         [Property("SPEC_URL", "-")]
60         [Property("CRITERIA", "PRW")]
61         public void ArrayExtensionItems()
62         {
63             tlog.Debug(tag, $"ArrayExtensionItems START");
64
65             try
66             {
67                 IList i1 = a1.Items;
68             }
69             catch (Exception e)
70             {
71                 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
72                 Assert.Fail("Caught Exception" + e.ToString());
73             }
74
75             tlog.Debug(tag, $"ArrayExtensionItems END (OK)");
76             Assert.Pass("ArrayExtensionItems");
77         }
78
79         [Test]
80         [Category("P1")]
81         [Description("ArrayExtension Type")]
82         [Property("SPEC", "Tizen.NUI.ArrayExtension.Type A")]
83         [Property("SPEC_URL", "-")]
84         [Property("CRITERIA", "PRW")]
85         public void ArrayExtensionType()
86         {
87             tlog.Debug(tag, $"ArrayExtensionType START");
88
89             try
90             {
91                 Type t1 = a1.Type;
92                 a1.Type = t1;
93             }
94             catch (Exception e)
95             {
96                 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
97                 Assert.Fail("Caught Exception" + e.ToString());
98             }
99
100             tlog.Debug(tag, $"ArrayExtensionType END (OK)");
101             Assert.Pass("ArrayExtensionType");
102         }
103
104         [Test]
105         [Category("P1")]
106         [Description("ArrayExtension ProvideValue")]
107         [Property("SPEC", "Tizen.NUI.ArrayExtension.ProvideValue A")]
108         [Property("SPEC_URL", "-")]
109         [Property("CRITERIA", "PRW")]
110         public void ArrayExtensionProvideValue()
111         {
112             tlog.Debug(tag, $"ArrayExtensionProvideValue START");
113
114             try
115             {
116                 IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
117                 a1.Type = typeof(string);
118
119                 a1.ProvideValue(serviceProviderimplement);
120             }
121             catch (Exception e)
122             {
123                 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
124                 Assert.Fail("Caught Exception" + e.ToString());
125             }
126
127             tlog.Debug(tag, $"ArrayExtensionProvideValue END (OK)");
128             Assert.Pass("ArrayExtensionProvideValue");
129         }
130     }
131 }