1 using NUnit.Framework;
3 using System.Collections.Generic;
7 namespace Tizen.NUI.Devel.Tests
9 using Tizen.NUI.Binding.Internals;
10 using tlog = Tizen.Log;
13 [Description("internal/Xaml/CreateValuesVisitor")]
14 internal class PublicCreateValuesVisitorTest
16 private const string tag = "NUITEST";
17 private static CreateValuesVisitor c1;
22 tlog.Info(tag, "Init() is called!");
23 HydrationContext context = new HydrationContext();
24 c1 = new CreateValuesVisitor(context);
31 tlog.Info(tag, "Destroy() is called!");
36 [Description("CreateValuesVisitor CreateValuesVisitor")]
37 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateValuesVisitor C")]
38 [Property("SPEC_URL", "-")]
39 [Property("CRITERIA", "CONSTR")]
40 public void CreateValuesVisitorConstructor()
42 tlog.Debug(tag, $"ApplyPropertiesVisitorConstructor START");
44 HydrationContext context = new HydrationContext();
46 CreateValuesVisitor createValuesVisitor = new CreateValuesVisitor(context);
48 tlog.Debug(tag, $"CreateValuesVisitorConstructor END (OK)");
49 Assert.Pass("CreateValuesVisitorConstructor");
54 [Description("CreateValuesVisitor VisitingMode")]
55 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.VisitingMode A")]
56 [Property("SPEC_URL", "-")]
57 [Property("CRITERIA", "PRW")]
58 public void CreateValuesVisitorVisitingMode()
60 tlog.Debug(tag, $"CreateValuesVisitorVisitingMode START");
64 TreeVisitingMode t1 = c1.VisitingMode;
68 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
69 Assert.Fail("Caught Exception" + e.ToString());
72 tlog.Debug(tag, $"CreateValuesVisitorVisitingMode END (OK)");
73 Assert.Pass("CreateValuesVisitorVisitingMode");
78 [Description("CreateValuesVisitor StopOnDataTemplate")]
79 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.StopOnDataTemplate A")]
80 [Property("SPEC_URL", "-")]
81 [Property("CRITERIA", "PRW")]
82 public void CreateValuesVisitorStopOnDataTemplate()
84 tlog.Debug(tag, $"CreateValuesVisitorStopOnDataTemplate START");
88 bool b1 = c1.StopOnDataTemplate;
92 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
93 Assert.Fail("Caught Exception" + e.ToString());
96 tlog.Debug(tag, $"CreateValuesVisitorStopOnDataTemplate END (OK)");
97 Assert.Pass("CreateValuesVisitorStopOnDataTemplate");
102 [Description("CreateValuesVisitor StopOnResourceDictionary ")]
103 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.StopOnResourceDictionary A")]
104 [Property("SPEC_URL", "-")]
105 [Property("CRITERIA", "PRW")]
106 public void CreateValuesVisitorStopOnResourceDictionary()
108 tlog.Debug(tag, $"CreateValuesVisitorStopOnResourceDictionary START");
112 bool b1 = c1.StopOnResourceDictionary;
116 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
117 Assert.Fail("Caught Exception" + e.ToString());
120 tlog.Debug(tag, $"CreateValuesVisitorStopOnResourceDictionary END (OK)");
121 Assert.Pass("CreateValuesVisitorStopOnResourceDictionary");
126 [Description("CreateValuesVisitor VisitNodeOnDataTemplate ")]
127 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.VisitNodeOnDataTemplate A")]
128 [Property("SPEC_URL", "-")]
129 [Property("CRITERIA", "PRW")]
130 public void CreateValuesVisitorVisitNodeOnDataTemplate()
132 tlog.Debug(tag, $"CreateValuesVisitorVisitNodeOnDataTemplate START");
136 bool b1 = c1.VisitNodeOnDataTemplate;
140 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
141 Assert.Fail("Caught Exception" + e.ToString());
144 tlog.Debug(tag, $"CreateValuesVisitorVisitNodeOnDataTemplate END (OK)");
145 Assert.Pass("CreateValuesVisitorVisitNodeOnDataTemplate");
148 public class INodeImplement : INode
150 public global::System.Collections.Generic.List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
152 public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
154 public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
156 public void Accept(IXamlNodeVisitor visitor, INode parentNode)
158 throw new NotImplementedException();
163 throw new NotImplementedException();
169 [Description("CreateValuesVisitor SkipChildren")]
170 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.SkipChildren M")]
171 [Property("SPEC_URL", "-")]
172 [Property("CRITERIA", "MR")]
173 public void CreateValuesVisitorSkipChildren()
175 tlog.Debug(tag, $"CreateValuesVisitorSkipChildren START");
179 INodeImplement node = new INodeImplement();
180 INodeImplement nodeParent = new INodeImplement();
181 bool b1 = c1.SkipChildren(node, nodeParent);
185 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
186 Assert.Fail("Caught Exception" + e.ToString());
189 tlog.Debug(tag, $"CreateValuesVisitorSkipChildren END (OK)");
190 Assert.Pass("CreateValuesVisitorSkipChildren");
193 public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
195 public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
197 throw new NotImplementedException();
200 public string LookupNamespace(string prefix)
202 throw new NotImplementedException();
205 public string LookupPrefix(string namespaceName)
207 throw new NotImplementedException();
213 [Description("CreateValuesVisitor IsResourceDictionary")]
214 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.IsResourceDictionary M")]
215 [Property("SPEC_URL", "-")]
216 [Property("CRITERIA", "MR")]
217 public void CreateValuesVisitorIsResourceDictionary()
219 tlog.Debug(tag, $"CreateValuesVisitorIsResourceDictionary START");
223 IList<XmlType> list = null;
224 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
226 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
227 ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
229 bool b1 = c1.IsResourceDictionary(n1);
233 tlog.Debug(tag, e.Message.ToString());
234 tlog.Debug(tag, $"CreateValuesVisitorIsResourceDictionary END (OK)");
235 Assert.Pass("Caught Exception : passed!");
239 public class RootNodeImplement : RootNode
241 public RootNodeImplement(XmlType xmlType, IXmlNamespaceResolver nsResolver) : base(xmlType, nsResolver)
248 [Description("CreateValuesVisitor Visit")]
249 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.Visit M")]
250 [Property("SPEC_URL", "-")]
251 [Property("CRITERIA", "MR")]
252 public void CreateValuesVisitorVisit1()
254 tlog.Debug(tag, $"CreateValuesVisitorVisit START");
258 object o1 = new object();
259 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
260 ValueNode node = new ValueNode(o1, i1);
261 INodeImplement parentNode = new INodeImplement();
262 c1.Visit(node, parentNode);
266 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
267 Assert.Fail("Caught Exception" + e.ToString());
270 tlog.Debug(tag, $"CreateValuesVisitorVisit END (OK)");
271 Assert.Pass("CreateValuesVisitorVisit");
276 [Description("CreateValuesVisitor Visit")]
277 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.Visit M")]
278 [Property("SPEC_URL", "-")]
279 [Property("CRITERIA", "MR")]
280 public void CreateValuesVisitorVisit2()
282 tlog.Debug(tag, $"CreateValuesVisitorVisit START");
286 INodeImplement parentNode = new INodeImplement();
288 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
289 IList<XmlType> list = null;
290 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
292 ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
294 c1.Visit(n1, parentNode);
298 tlog.Debug(tag, e.Message.ToString());
299 tlog.Debug(tag, $"CreateValuesVisitorVisit END (OK)");
300 Assert.Pass("Caught Exception : passed!");
306 [Description("CreateValuesVisitor Visit")]
307 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.Visit M")]
308 [Property("SPEC_URL", "-")]
309 [Property("CRITERIA", "MR")]
310 public void CreateValuesVisitorVisit3()
312 tlog.Debug(tag, $"CreateValuesVisitorVisit START");
316 INodeImplement parentNode = new INodeImplement();
317 IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
318 IList<XmlType> list = null;
319 XmlType xmlType = new XmlType("myNameSpace", "myName", list);
320 RootNodeImplement rootNode = new RootNodeImplement(xmlType, i1);
321 c1.Visit(rootNode, parentNode);
325 tlog.Debug(tag, e.Message.ToString());
326 tlog.Debug(tag, $"CreateValuesVisitorVisit END (OK)");
327 Assert.Pass("Caught Exception : passed!");
332 public class IElementNodeImplement : IElementNode
334 public Dictionary<XmlName, INode> Properties => throw new NotImplementedException();
336 public List<XmlName> SkipProperties => throw new NotImplementedException();
338 public INameScope Namescope => throw new NotImplementedException();
340 public XmlType XmlType => throw new NotImplementedException();
342 public string NamespaceURI => throw new NotImplementedException();
344 public List<INode> CollectionItems => throw new NotImplementedException();
346 public List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
348 public IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
350 public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
352 public void Accept(IXamlNodeVisitor visitor, INode parentNode)
354 throw new NotImplementedException();
359 throw new NotImplementedException();
365 [Description("CreateValuesVisitor CreateFromParameterizedConstructor")]
366 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateFromParameterizedConstructor M")]
367 [Property("SPEC_URL", "-")]
368 [Property("CRITERIA", "MR")]
369 public void CreateValuesVisitorCreateFromParameterizedConstructor()
371 tlog.Debug(tag, $"CreateValuesVisitorCreateFromParameterizedConstructor START");
375 Type type = typeof(string);
376 IElementNodeImplement i1 = new IElementNodeImplement();
377 c1.CreateFromParameterizedConstructor(type, i1);
381 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
382 Assert.Fail("Caught Exception" + e.ToString());
385 tlog.Debug(tag, $"CreateValuesVisitorCreateFromParameterizedConstructor END (OK)");
386 Assert.Pass("CreateValuesVisitorCreateFromParameterizedConstructor");
391 [Description("CreateValuesVisitor CreateFromFactory")]
392 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateFromFactory M")]
393 [Property("SPEC_URL", "-")]
394 [Property("CRITERIA", "MR")]
395 public void CreateValuesVisitorCreateFromFactory()
397 tlog.Debug(tag, $"CreateValuesVisitorCreateFromFactory START");
401 Type type = typeof(string);
402 IElementNodeImplement i1 = new IElementNodeImplement();
403 c1.CreateFromFactory(type, i1);
407 tlog.Debug(tag, e.Message.ToString());
408 tlog.Debug(tag, $"CreateValuesVisitorCreateFromFactory END (OK)");
409 Assert.Pass("Caught Exception : passed!");
415 [Description("CreateValuesVisitor CreateArgumentsArray")]
416 [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateArgumentsArray M")]
417 [Property("SPEC_URL", "-")]
418 [Property("CRITERIA", "MR")]
419 public void CreateValuesVisitorCreateArgumentsArray()
421 tlog.Debug(tag, $"CreateValuesVisitorCreateArgumentsArray START");
425 IElementNodeImplement i1 = new IElementNodeImplement();
426 c1.CreateArgumentsArray(i1);
430 tlog.Debug(tag, e.Message.ToString());
431 tlog.Debug(tag, $"CreateValuesVisitorCreateArgumentsArray END (OK)");
432 Assert.Pass("Caught Exception : passed!");