1 using NUnit.Framework;
3 using System.Collections.Generic;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("internal/Xaml/PruneIgnoredNodesVisitor")]
13 internal class PublicPruneIgnoredNodesVisitorTest
15 private const string tag = "NUITEST";
16 private static PruneIgnoredNodesVisitor p1;
21 tlog.Info(tag, "Init() is called!");
22 p1 = new PruneIgnoredNodesVisitor();
29 tlog.Info(tag, "Destroy() is called!");
34 [Description("PruneIgnoredNodesVisitor VisitingMode")]
35 [Property("SPEC", "Tizen.NUI.PruneIgnoredNodesVisitor.VisitingMode A")]
36 [Property("SPEC_URL", "-")]
37 [Property("CRITERIA", "PRW")]
38 public void PruneIgnoredNodesVisitorVisitingMode()
40 tlog.Debug(tag, $"NamescopingVisitorVisitingMode START");
44 TreeVisitingMode t1 = p1.VisitingMode;
48 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
49 Assert.Fail("Caught Exception" + e.ToString());
52 tlog.Debug(tag, $"PruneIgnoredNodesVisitorVisitingMode END (OK)");
53 Assert.Pass("PruneIgnoredNodesVisitorVisitingMode");
58 [Description("NamescopingVisitor StopOnDataTemplate")]
59 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnDataTemplate A")]
60 [Property("SPEC_URL", "-")]
61 [Property("CRITERIA", "PRW")]
62 public void NamescopingVisitorStopOnDataTemplate()
64 tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate START");
68 bool b1 = p1.StopOnDataTemplate;
72 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
73 Assert.Fail("Caught Exception" + e.ToString());
76 tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate END (OK)");
77 Assert.Pass("NamescopingVisitorStopOnDataTemplate");
82 [Description("NamescopingVisitor StopOnResourceDictionary")]
83 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnResourceDictionary A")]
84 [Property("SPEC_URL", "-")]
85 [Property("CRITERIA", "PRW")]
86 public void NamescopingVisitorStopOnResourceDictionary()
88 tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary START");
92 bool b1 = p1.StopOnResourceDictionary;
96 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
97 Assert.Fail("Caught Exception" + e.ToString());
100 tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary END (OK)");
101 Assert.Pass("NamescopingVisitorStopOnResourceDictionary");
106 [Description("NamescopingVisitor VisitNodeOnDataTemplate")]
107 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.VisitNodeOnDataTemplate A")]
108 [Property("SPEC_URL", "-")]
109 [Property("CRITERIA", "PRW")]
110 public void NamescopingVisitorVisitNodeOnDataTemplate()
112 tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate START");
116 bool b1 = p1.VisitNodeOnDataTemplate;
120 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
121 Assert.Fail("Caught Exception" + e.ToString());
124 tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate END (OK)");
125 Assert.Pass("NamescopingVisitorVisitNodeOnDataTemplate");
128 public class INodeImplement : INode
130 public global::System.Collections.Generic.List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
132 public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
134 public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
136 public void Accept(IXamlNodeVisitor visitor, INode parentNode)
138 throw new NotImplementedException();
143 throw new NotImplementedException();
149 [Description("NamescopingVisitor SkipChildren")]
150 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.SkipChildren M")]
151 [Property("SPEC_URL", "-")]
152 [Property("CRITERIA", "MR")]
153 public void NamescopingVisitorSkipChildren()
155 tlog.Debug(tag, $"NamescopingVisitorSkipChildren START");
159 INodeImplement node = new INodeImplement();
160 INodeImplement nodeParent = new INodeImplement();
161 bool b1 = p1.SkipChildren(node, nodeParent);
165 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
166 Assert.Fail("Caught Exception" + e.ToString());
169 tlog.Debug(tag, $"NamescopingVisitorSkipChildren END (OK)");
170 Assert.Pass("NamescopingVisitorSkipChildren");
173 public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
175 public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
177 throw new NotImplementedException();
180 public string LookupNamespace(string prefix)
182 throw new NotImplementedException();
185 public string LookupPrefix(string namespaceName)
187 throw new NotImplementedException();
193 [Description("NamescopingVisitor IsResourceDictionary")]
194 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.IsResourceDictionary M")]
195 [Property("SPEC_URL", "-")]
196 [Property("CRITERIA", "MR")]
197 public void NamescopingVisitorIsResourceDictionary()
199 tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary START");
203 IList<XmlType> list = null;
204 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
206 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
207 ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
209 bool b1 = p1.IsResourceDictionary(n1);
213 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
214 Assert.Fail("Caught Exception" + e.ToString());
217 tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary END (OK)");
218 Assert.Pass("NamescopingVisitorIsResourceDictionary");
221 public class RootNodeImplement : RootNode
223 public RootNodeImplement(XmlType xmlType, IXmlNamespaceResolver nsResolver) : base(xmlType, nsResolver)
230 [Description("NamescopingVisitor Visit")]
231 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
232 [Property("SPEC_URL", "-")]
233 [Property("CRITERIA", "MR")]
234 public void NamescopingVisitorVisit1()
236 tlog.Debug(tag, $"NamescopingVisitorVisit START");
240 IList<XmlType> list = null;
241 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
243 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
244 ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
246 INodeImplement parentNode = new INodeImplement();
247 p1.Visit(n1, parentNode);
251 tlog.Debug(tag, e.Message.ToString());
252 tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
253 Assert.Pass("Caught Exception : passed!");
259 [Description("NamescopingVisitor Visit")]
260 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
261 [Property("SPEC_URL", "-")]
262 [Property("CRITERIA", "MR")]
263 public void NamescopingVisitorVisit2()
265 tlog.Debug(tag, $"NamescopingVisitorVisit START");
269 IList<XmlType> list = null;
270 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
272 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
274 INodeImplement parentNode = new INodeImplement();
276 RootNodeImplement rootNode = new RootNodeImplement(xmlType, i1);
277 p1.Visit(rootNode, parentNode);
281 tlog.Debug(tag, e.Message.ToString());
282 tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
283 Assert.Pass("Caught Exception : passed!");
289 [Description("NamescopingVisitor Visit")]
290 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
291 [Property("SPEC_URL", "-")]
292 [Property("CRITERIA", "MR")]
293 public void NamescopingVisitorVisit3()
295 tlog.Debug(tag, $"NamescopingVisitorVisit START");
299 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
301 INodeImplement parentNode = new INodeImplement();
302 IList<INode> nodes = null;
303 ListNode li = new ListNode(nodes, i1);
304 p1.Visit(li, parentNode);
308 tlog.Debug(tag, e.Message.ToString());
309 tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
310 Assert.Pass("Caught Exception : passed!");