1 using NUnit.Framework;
3 using System.Collections.Generic;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("internal/Xaml/FillResourceDictionariesVisitor")]
13 internal class PublicFillResourceDictionariesVisitorTest
15 private const string tag = "NUITEST";
16 private static FillResourceDictionariesVisitor f1;
21 tlog.Info(tag, "Init() is called!");
22 HydrationContext context = new HydrationContext();
23 f1 = new FillResourceDictionariesVisitor(context);
29 tlog.Info(tag, "Destroy() is called!");
34 [Description("FillResourceDictionariesVisitor FillResourceDictionariesVisitor")]
35 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.FillResourceDictionariesVisitor C")]
36 [Property("SPEC_URL", "-")]
37 [Property("CRITERIA", "CONSTR")]
38 public void FillResourceDictionariesVisitorConstructor()
40 tlog.Debug(tag, $"FillResourceDictionariesVisitorConstructor START");
42 HydrationContext context = new HydrationContext();
44 FillResourceDictionariesVisitor fillResourceDictionariesVisitor = new FillResourceDictionariesVisitor(context);
46 tlog.Debug(tag, $"FillResourceDictionariesVisitorConstructor END (OK)");
47 Assert.Pass("FillResourceDictionariesVisitorConstructor");
52 [Description("FillResourceDictionariesVisitor VisitingMode")]
53 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.VisitingMode A")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "PRW")]
56 public void FillResourceDictionariesVisitorVisitingMode()
58 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitingMode START");
62 TreeVisitingMode t1 = f1.VisitingMode;
66 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
67 Assert.Fail("Caught Exception" + e.ToString());
70 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitingMode END (OK)");
71 Assert.Pass("FillResourceDictionariesVisitorVisitingMode");
76 [Description("FillResourceDictionariesVisitor StopOnDataTemplate")]
77 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.StopOnDataTemplate A")]
78 [Property("SPEC_URL", "-")]
79 [Property("CRITERIA", "PRW")]
80 public void FillResourceDictionariesVisitorStopOnDataTemplate()
82 tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnDataTemplate START");
86 bool b1 = f1.StopOnDataTemplate;
90 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
91 Assert.Fail("Caught Exception" + e.ToString());
94 tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnDataTemplate END (OK)");
95 Assert.Pass("FillResourceDictionariesVisitorStopOnDataTemplate");
100 [Description("FillResourceDictionariesVisitor StopOnResourceDictionary")]
101 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.StopOnResourceDictionary A")]
102 [Property("SPEC_URL", "-")]
103 [Property("CRITERIA", "PRW")]
104 public void FillResourceDictionariesVisitorStopOnResourceDictionary()
106 tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnResourceDictionary START");
110 bool b1 = f1.StopOnResourceDictionary;
114 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
115 Assert.Fail("Caught Exception" + e.ToString());
118 tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnResourceDictionary END (OK)");
119 Assert.Pass("FillResourceDictionariesVisitorStopOnResourceDictionary");
124 [Description("FillResourceDictionariesVisitor VisitNodeOnDataTemplate")]
125 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.VisitNodeOnDataTemplate A")]
126 [Property("SPEC_URL", "-")]
127 [Property("CRITERIA", "PRW")]
128 public void FillResourceDictionariesVisitorVisitNodeOnDataTemplate()
130 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate START");
134 bool b1 = f1.VisitNodeOnDataTemplate;
138 tlog.Debug(tag, e.Message.ToString());
139 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate END (OK)");
140 Assert.Pass("Caught Exception : passed!");
145 public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
147 public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
149 throw new NotImplementedException();
152 public string LookupNamespace(string prefix)
154 throw new NotImplementedException();
157 public string LookupPrefix(string namespaceName)
159 throw new NotImplementedException();
165 [Description("FillResourceDictionariesVisitor IsResourceDictionary")]
166 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.IsResourceDictionary M")]
167 [Property("SPEC_URL", "-")]
168 [Property("CRITERIA", "MR")]
169 public void FillResourceDictionariesVisitorIsResourceDictionary()
171 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate START");
175 IList<XmlType> list = null;
176 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
178 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
179 ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
181 bool b1 = f1.IsResourceDictionary(n1);
185 tlog.Debug(tag, e.Message.ToString());
186 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate END (OK)");
187 Assert.Pass("Caught Exception : passed!");
191 public class INodeImplement : INode
193 public List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
195 public IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
197 public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
199 public void Accept(IXamlNodeVisitor visitor, INode parentNode)
201 throw new NotImplementedException();
206 throw new NotImplementedException();
212 [Description("FillResourceDictionariesVisitor Visit")]
213 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.Visit M")]
214 [Property("SPEC_URL", "-")]
215 [Property("CRITERIA", "MR")]
216 public void FillResourceDictionariesVisitorVisit1()
218 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit START");
222 object o1 = new object();
223 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
224 ValueNode node = new ValueNode(o1, i1);
226 INodeImplement parentNode = new INodeImplement();
228 f1.Visit(node, parentNode);
232 tlog.Debug(tag, e.Message.ToString());
233 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit END (OK)");
234 Assert.Pass("Caught Exception : passed!");
240 [Description("FillResourceDictionariesVisitor Visit")]
241 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.Visit M")]
242 [Property("SPEC_URL", "-")]
243 [Property("CRITERIA", "MR")]
244 public void FillResourceDictionariesVisitorVisit2()
246 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit START");
251 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
253 INodeImplement parentNode = new INodeImplement();
255 IList<XmlType> list = null;
256 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
258 ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
260 f1.Visit(n1, parentNode);
264 tlog.Debug(tag, e.Message.ToString());
265 tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit END (OK)");
266 Assert.Pass("Caught Exception : passed!");
273 [Description("FillResourceDictionariesVisitor SkipChildren")]
274 [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.SkipChildren M")]
275 [Property("SPEC_URL", "-")]
276 [Property("CRITERIA", "MR")]
277 public void FillResourceDictionariesVisitorSkipChildren()
279 tlog.Debug(tag, $"FillResourceDictionariesVisitorSkipChildren START");
283 INodeImplement nodeImplement = new INodeImplement();
284 INodeImplement parentNode = new INodeImplement();
286 f1.SkipChildren(nodeImplement, parentNode);
291 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
292 Assert.Fail("Caught Exception" + e.ToString());
295 tlog.Debug(tag, $"FillResourceDictionariesVisitorSkipChildren END (OK)");
296 Assert.Pass("FillResourceDictionariesVisitorSkipChildren");