3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 using Tizen.NUI.Binding.Internals;
9 namespace Tizen.NUI.Devel.Tests
11 using tlog = Tizen.Log;
14 [Description("public/xaml/MarkupExtensions/ReferenceExtension")]
15 public class PublicReferenceExtensionTest
17 private const string tag = "NUITEST";
18 private Tizen.NUI.Xaml.ReferenceExtension reference;
20 internal class IServiceProviderImpl : IServiceProvider
22 public object GetService(Type serviceType) { return null; }
25 internal class IServiceProviderImpl2 : IServiceProvider
27 public object GetService(Type serviceType) { return new NameScopeProvider() { NameScope = new NameScope() { } }; }
33 tlog.Info(tag, "Init() is called!");
34 reference = new Tizen.NUI.Xaml.ReferenceExtension();
41 tlog.Info(tag, "Destroy() is called!");
46 [Description("ReferenceExtension Name")]
47 [Property("SPEC", "Tizen.NUI.ReferenceExtension.Name A")]
48 [Property("SPEC_URL", "-")]
49 [Property("CRITERIA", "PRW")]
50 public void ReferenceExtensionName()
52 tlog.Debug(tag, $"ReferenceExtensionName START");
56 var name = reference.Name;
57 reference.Name = name;
58 Assert.AreEqual(name, reference.Name, "Should be equal");
62 tlog.Debug(tag, e.Message.ToString());
63 Assert.Fail("Caught Exception : Failed!");
66 tlog.Debug(tag, $"ReferenceExtensionName END");
71 [Description("ReferenceExtension ProvideValue")]
72 [Property("SPEC", "Tizen.NUI.ReferenceExtension.ProvideValue M")]
73 [Property("SPEC_URL", "-")]
74 [Property("CRITERIA", "MR")]
75 public void ReferenceExtensionProvideValue()
77 tlog.Debug(tag, $"ReferenceExtensionProvideValue START");
78 Assert.Throws<ArgumentException>(() => reference.ProvideValue(new IServiceProviderImpl()));
79 tlog.Debug(tag, $"ReferenceExtensionProvideValue END");
84 [Description("ReferenceExtension ProvideValue")]
85 [Property("SPEC", "Tizen.NUI.ReferenceExtension.ProvideValue M")]
86 [Property("SPEC_URL", "-")]
87 [Property("CRITERIA", "MR")]
88 public void ReferenceExtensionProvideValue2()
90 tlog.Debug(tag, $"ReferenceExtensionProvideValue2 START");
91 Assert.Throws<ArgumentNullException>(() => reference.ProvideValue(null));
92 tlog.Debug(tag, $"ReferenceExtensionProvideValue2 END");