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 public class InternalPruneIgnoredNodesVisitorTest
15 private const string tag = "NUITEST";
16 private PruneIgnoredNodesVisitor visitor;
18 internal class INodeImpl : INode
20 public global::System.Collections.Generic.List<string> IgnorablePrefixes { get; set; }
21 public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => new INodeImpl().NamespaceResolver;
22 public INode Parent { get; set; }
23 public void Accept(IXamlNodeVisitor visitor, INode parentNode) { }
24 public INode Clone() { return new INodeImpl(); }
30 tlog.Info(tag, "Init() is called!");
31 visitor = new PruneIgnoredNodesVisitor();
38 tlog.Info(tag, "Destroy() is called!");
43 [Description("PruneIgnoredNodesVisitor VisitingMode")]
44 [Property("SPEC", "Tizen.NUI.PruneIgnoredNodesVisitor.VisitingMode A")]
45 [Property("SPEC_URL", "-")]
46 [Property("CRITERIA", "PRW")]
47 public void PruneIgnoredNodesVisitorVisitingMode()
49 tlog.Debug(tag, $"NamescopingVisitorVisitingMode START");
53 var result = visitor.VisitingMode;
54 tlog.Debug(tag, "VisitingMode : " + result);
58 tlog.Debug(tag, e.Message.ToString());
59 Assert.Fail("Caught Exception : Failed!");
62 tlog.Debug(tag, $"PruneIgnoredNodesVisitorVisitingMode END");
67 [Description("NamescopingVisitor StopOnDataTemplate")]
68 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnDataTemplate A")]
69 [Property("SPEC_URL", "-")]
70 [Property("CRITERIA", "PRW")]
71 public void NamescopingVisitorStopOnDataTemplate()
73 tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate START");
77 var result = visitor.StopOnDataTemplate;
78 tlog.Debug(tag, "StopOnDataTemplate : " + result);
82 tlog.Debug(tag, e.Message.ToString());
83 Assert.Fail("Caught Exception : Failed!");
86 tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate END");
91 [Description("NamescopingVisitor StopOnResourceDictionary")]
92 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnResourceDictionary A")]
93 [Property("SPEC_URL", "-")]
94 [Property("CRITERIA", "PRW")]
95 public void NamescopingVisitorStopOnResourceDictionary()
97 tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary START");
101 var result = visitor.StopOnResourceDictionary;
102 tlog.Debug(tag, "StopOnResourceDictionary : " + result);
106 tlog.Debug(tag, e.Message.ToString());
107 Assert.Fail("Caught Exception : Failed!");
110 tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary END");
115 [Description("NamescopingVisitor VisitNodeOnDataTemplate")]
116 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.VisitNodeOnDataTemplate A")]
117 [Property("SPEC_URL", "-")]
118 [Property("CRITERIA", "PRW")]
119 public void NamescopingVisitorVisitNodeOnDataTemplate()
121 tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate START");
125 var result = visitor.VisitNodeOnDataTemplate;
126 tlog.Debug(tag, "VisitNodeOnDataTemplate : " + result);
130 tlog.Debug(tag, e.Message.ToString());
131 Assert.Fail("Caught Exception : Failed!");
134 tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate END");
139 [Description("NamescopingVisitor SkipChildren")]
140 [Property("SPEC", "Tizen.NUI.NamescopingVisitor.SkipChildren M")]
141 [Property("SPEC_URL", "-")]
142 [Property("CRITERIA", "MR")]
143 public void NamescopingVisitorSkipChildren()
145 tlog.Debug(tag, $"NamescopingVisitorSkipChildren START");
149 var child = new INodeImpl();
150 Assert.IsNotNull(child, "null INodeImpl object.");
152 var parent = new INodeImpl();
153 Assert.IsNotNull(parent, "null INodeImpl object.");
155 var result = visitor.SkipChildren(child, parent);
156 tlog.Debug(tag, "SkipChildren : " + result);
160 tlog.Debug(tag, e.Message.ToString());
161 Assert.Fail("Caught Exception : Failed!");
164 tlog.Debug(tag, $"NamescopingVisitorSkipChildren END");