1 using NUnit.Framework;
3 using System.Collections;
6 namespace Tizen.NUI.Devel.Tests
8 using tlog = Tizen.Log;
11 [Description("public/xaml/MarkupExtensions/ArrayExtension")]
12 public class PublicArrayExtensionTest
14 private const string tag = "NUITEST";
15 private ArrayExtension array;
17 internal class IServiceProviderImpl : IServiceProvider
19 public object GetService(Type serviceType) { return null; }
25 tlog.Info(tag, "Init() is called!");
26 array = new ArrayExtension();
33 tlog.Info(tag, "Destroy() is called!");
38 [Description("ArrayExtension Items")]
39 [Property("SPEC", "Tizen.NUI.ArrayExtension.Items A")]
40 [Property("SPEC_URL", "-")]
41 [Property("CRITERIA", "PRW")]
42 public void ArrayExtensionItems()
44 tlog.Debug(tag, $"ArrayExtensionItems START");
48 var item = array.Items; // empty
49 tlog.Debug(tag, "Items : " + item);
53 tlog.Debug(tag, e.Message.ToString());
54 Assert.Fail("Caught Exception : Failed!");
57 tlog.Debug(tag, $"ArrayExtensionItems END");
62 [Description("ArrayExtension ProvideValue")]
63 [Property("SPEC", "Tizen.NUI.ArrayExtension.ProvideValue A")]
64 [Property("SPEC_URL", "-")]
65 [Property("CRITERIA", "PRW")]
66 public void ArrayExtensionProvideValue()
68 tlog.Debug(tag, $"ArrayExtensionProvideValue START");
72 array.Type = typeof(string);
73 tlog.Debug(tag, "Type : " + array.Type);
74 array.ProvideValue(new IServiceProviderImpl());
78 tlog.Debug(tag, e.Message.ToString());
79 Assert.Fail("Caught Exception : Failed!");
82 tlog.Debug(tag, $"ArrayExtensionProvideValue END");
87 [Description("ArrayExtension ProvideValue")]
88 [Property("SPEC", "Tizen.NUI.ArrayExtension.ProvideValue A")]
89 [Property("SPEC_URL", "-")]
90 [Property("CRITERIA", "PRW")]
91 public void ArrayExtensionProvideValueWithNullType()
93 tlog.Debug(tag, $"ArrayExtensionProvideValueWithNullType START");
98 array.ProvideValue(new IServiceProviderImpl());
100 catch (InvalidOperationException e)
102 tlog.Debug(tag, e.Message.ToString());
103 tlog.Debug(tag, $"ArrayExtensionProvideValueWithNullType END");
104 Assert.Pass("Caught InvalidOperationException : Passed!");