1 using NUnit.Framework;
3 using System.Collections.Generic;
6 using static Tizen.NUI.Xaml.ExpandMarkupsVisitor;
8 namespace Tizen.NUI.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("internal/Xaml/ExpandMarkupsVisitor")]
14 public class InternalExpandMarkupsVisitorTest
16 private const string tag = "NUITEST";
17 private ExpandMarkupsVisitor e1;
22 tlog.Info(tag, "Init() is called!");
23 HydrationContext context = new HydrationContext();
25 e1 = new ExpandMarkupsVisitor(context);
32 tlog.Info(tag, "Destroy() is called!");
37 [Description("ExpandMarkupsVisitor ExpandMarkupsVisitor")]
38 [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.ExpandMarkupsVisitor C")]
39 [Property("SPEC_URL", "-")]
40 [Property("CRITERIA", "CONSTR")]
41 public void ExpandMarkupsVisitorConstructor()
43 tlog.Debug(tag, $"ApplyPropertiesVisitorConstructor START");
45 HydrationContext context = new HydrationContext();
47 ExpandMarkupsVisitor expandMarkupsVisitor = new ExpandMarkupsVisitor(context);
49 tlog.Debug(tag, $"ExpandMarkupsVisitorConstructor END (OK)");
50 Assert.Pass("ExpandMarkupsVisitorConstructor");
55 [Description("ExpandMarkupsVisitor Skips")]
56 [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.Skips A")]
57 [Property("SPEC_URL", "-")]
58 [Property("CRITERIA", "PRW")]
59 public void ExpandMarkupsVisitorSkips()
61 tlog.Debug(tag, $"ExpandMarkupsVisitorSkips START");
65 IList<XmlName> l1 = ExpandMarkupsVisitor.Skips;
69 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
70 Assert.Fail("Caught Exception" + e.ToString());
73 tlog.Debug(tag, $"ExpandMarkupsVisitorSkips END (OK)");
74 Assert.Pass("ExpandMarkupsVisitorSkips");
79 [Description("ExpandMarkupsVisitor VisitingMode")]
80 [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.VisitingMode A")]
81 [Property("SPEC_URL", "-")]
82 [Property("CRITERIA", "PRW")]
83 public void ExpandMarkupsVisitorVisitingMode()
85 tlog.Debug(tag, $"ExpandMarkupsVisitorVisitingMode START");
89 TreeVisitingMode t1 = e1.VisitingMode;
93 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
94 Assert.Fail("Caught Exception" + e.ToString());
97 tlog.Debug(tag, $"ExpandMarkupsVisitorVisitingMode END (OK)");
98 Assert.Pass("ExpandMarkupsVisitorVisitingMode");
103 [Description("ExpandMarkupsVisitor StopOnDataTemplate")]
104 [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.StopOnDataTemplate A")]
105 [Property("SPEC_URL", "-")]
106 [Property("CRITERIA", "PRW")]
107 public void ExpandMarkupsVisitorStopOnDataTemplate()
109 tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnDataTemplate START");
113 bool b1 = e1.StopOnDataTemplate;
117 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
118 Assert.Fail("Caught Exception" + e.ToString());
121 tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnDataTemplate END (OK)");
122 Assert.Pass("ExpandMarkupsVisitorStopOnDataTemplate");
127 [Description("ExpandMarkupsVisitor StopOnResourceDictionary")]
128 [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.StopOnResourceDictionary A")]
129 [Property("SPEC_URL", "-")]
130 [Property("CRITERIA", "PRW")]
131 public void ExpandMarkupsVisitorStopOnResourceDictionary()
133 tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnResourceDictionary START");
137 bool b1 = e1.StopOnResourceDictionary;
141 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
142 Assert.Fail("Caught Exception" + e.ToString());
145 tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnResourceDictionary END (OK)");
146 Assert.Pass("ExpandMarkupsVisitorStopOnResourceDictionary");
151 [Description("ExpandMarkupsVisitor VisitNodeOnDataTemplate")]
152 [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.VisitNodeOnDataTemplate A")]
153 [Property("SPEC_URL", "-")]
154 [Property("CRITERIA", "PRW")]
155 public void ExpandMarkupsVisitorVisitNodeOnDataTemplate()
157 tlog.Debug(tag, $"ExpandMarkupsVisitorVisitNodeOnDataTemplate START");
161 bool b1 = e1.VisitNodeOnDataTemplate;
165 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
166 Assert.Fail("Caught Exception" + e.ToString());
169 tlog.Debug(tag, $"ExpandMarkupsVisitorVisitNodeOnDataTemplate END (OK)");
170 Assert.Pass("ExpandMarkupsVisitorVisitNodeOnDataTemplate");
173 internal class INodeImplement : INode
175 public global::System.Collections.Generic.List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
177 public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
179 public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
181 public void Accept(IXamlNodeVisitor visitor, INode parentNode)
183 throw new NotImplementedException();
188 throw new NotImplementedException();
194 [Description("ExpandMarkupsVisitor SkipChildren")]
195 [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.SkipChildren M")]
196 [Property("SPEC_URL", "-")]
197 [Property("CRITERIA", "MR")]
198 public void ExpandMarkupsVisitorSkipChildren()
200 tlog.Debug(tag, $"ExpandMarkupsVisitorSkipChildren START");
204 INodeImplement node = new INodeImplement();
205 INodeImplement nodeParent = new INodeImplement();
206 bool b1 = e1.SkipChildren(node, nodeParent);
210 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
211 Assert.Fail("Caught Exception" + e.ToString());
214 tlog.Debug(tag, $"ExpandMarkupsVisitorSkipChildren END (OK)");
215 Assert.Pass("ExpandMarkupsVisitorSkipChildren");
218 public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
220 public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
222 throw new NotImplementedException();
225 public string LookupNamespace(string prefix)
227 throw new NotImplementedException();
230 public string LookupPrefix(string namespaceName)
232 throw new NotImplementedException();
238 //[Description("ExpandMarkupsVisitor IsResourceDictionary")]
239 //[Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.IsResourceDictionary M")]
240 //[Property("SPEC_URL", "-")]
241 //[Property("CRITERIA", "MR")]
242 //public void ExpandMarkupsVisitorIsResourceDictionary()
244 // tlog.Debug(tag, $"ExpandMarkupsVisitorIsResourceDictionary START");
248 // IList<XmlType> list = null;
249 // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
251 // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
252 // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
254 // bool b1 = e1.IsResourceDictionary(n1);
256 // catch (Exception e)
258 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
259 // Assert.Fail("Caught Exception" + e.ToString());
262 // tlog.Debug(tag, $"ExpandMarkupsVisitorIsResourceDictionary END (OK)");
263 // Assert.Pass("ExpandMarkupsVisitorIsResourceDictionary");
268 //[Description("ExpandMarkupsVisitor Visit")]
269 //[Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.Visit M")]
270 //[Property("SPEC_URL", "-")]
271 //[Property("CRITERIA", "MR")]
272 //public void ExpandMarkupsVisitorVisit()
274 // tlog.Debug(tag, $"ExpandMarkupsVisitorVisit START");
278 // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
279 // MarkupNode markupnode = new MarkupNode("markup", i1);
280 // INodeImplement parentNode = new INodeImplement();
281 // e1.Visit(markupnode, parentNode);
283 // catch (Exception e)
285 // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
286 // Assert.Fail("Caught Exception" + e.ToString());
289 // tlog.Debug(tag, $"ExpandMarkupsVisitorVisit END (OK)");
290 // Assert.Pass("ExpandMarkupsVisitorVisit");
293 //public class IServiceProviderImplement : IServiceProvider
295 // public object GetService(Type serviceType)
297 // throw new NotImplementedException();
303 //[Description("ExpandMarkupsVisitor Parse")]
304 //[Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.MarkupExpansionParser.Parse M")]
305 //[Property("SPEC_URL", "-")]
306 //[Property("CRITERIA", "MR")]
307 //public void ExpandMarkupsVisitorParse()
309 // tlog.Debug(tag, $"ExpandMarkupsVisitorParse START");
313 // MarkupExpansionParser markupExpansionParser = new MarkupExpansionParser();
314 // IServiceProviderImplement serviceProviderImplement = new IServiceProviderImplement();
316 // string s1 = new string('a', 4);
317 // markupExpansionParser.Parse("matchString", ref s1, serviceProviderImplement);
319 // catch (Exception e)
321 // tlog.Debug(tag, e.Message.ToString());
322 // tlog.Debug(tag, $"ExpandMarkupsVisitorParse END (OK)");
323 // Assert.Pass("Caught Exception : passed!");