1 using NUnit.Framework;
6 namespace Tizen.NUI.Devel.Tests
8 using tlog = Tizen.Log;
11 [Description("public/xaml/XamlParseException ")]
12 public class PublicXamlParseExceptionTest
14 private const string tag = "NUITEST";
15 private XamlParseException xamlParse;
17 internal class XmlLineInfoImpl : IXmlLineInfo
19 public int LineNumber => 0;
20 public int LinePosition => 0;
21 public bool HasLineInfo() => false;
27 tlog.Info(tag, "Init() is called!");
28 xamlParse = new XamlParseException("myMessage");
35 tlog.Info(tag, "Destroy() is called!");
40 [Description("XamlParseException XamlParseException")]
41 [Property("SPEC", "Tizen.NUI.XamlParseException.XamlParseException C")]
42 [Property("SPEC_URL", "-")]
43 [Property("CRITERIA", "CONSTR")]
44 public void XamlParseExceptionConstructor()
46 tlog.Debug(tag, $"XamlParseExceptionConstructor START");
48 var testingTarget = new XamlParseException();
49 Assert.IsNotNull(testingTarget, "null XamlParseException");
50 Assert.IsInstanceOf<XamlParseException>(testingTarget, "Should return XamlParseException instance.");
53 tlog.Debug(tag, $"XamlParseExceptionConstructor END");
58 [Description("XamlParseException XamlParseException")]
59 [Property("SPEC", "Tizen.NUI.XamlParseException.XamlParseException C")]
60 [Property("SPEC_URL", "-")]
61 [Property("CRITERIA", "CONSTR")]
62 public void XamlParseExceptionConstructorWithMessage()
64 tlog.Debug(tag, $"XamlParseExceptionConstructorWithMessage START");
66 var testingTarget = new XamlParseException("myMessage", new Exception());
67 Assert.IsNotNull(testingTarget, "null XamlParseException");
68 Assert.IsInstanceOf<XamlParseException>(testingTarget, "Should return XamlParseException instance.");
71 tlog.Debug(tag, $"XamlParseExceptionConstructorWithMessage END");
75 [Description("XamlParseException XamlParseException")]
76 [Property("SPEC", "Tizen.NUI.XamlParseException.XamlParseException C")]
77 [Property("SPEC_URL", "-")]
78 [Property("CRITERIA", "CONSTR")]
79 public void XamlParseExceptionConstructor3()
81 tlog.Debug(tag, $"XamlParseExceptionConstructor START");
83 Exception e1 = new Exception();
84 XamlParseException x3 = new XamlParseException("myMessage", e1);
85 Assert.IsNotNull(x3, "null XamlParseException");
86 Assert.IsInstanceOf<XamlParseException>(x3, "Should return XamlParseException instance.");
88 tlog.Debug(tag, $"XamlParseExceptionConstructor END");
93 [Description("XamlParseException XmlInfo ")]
94 [Property("SPEC", "Tizen.NUI.XamlParseException.XmlInfo A")]
95 [Property("SPEC_URL", "-")]
96 [Property("CRITERIA", "PRW")]
97 public void XamlParseExceptionXmlInfo()
99 tlog.Debug(tag, $"XamlParseExceptionXmlInfo START");
103 var result = (XmlLineInfoImpl)xamlParse.XmlInfo;
104 tlog.Debug(tag, "XmlInfo : " + result);
108 tlog.Debug(tag, e.Message.ToString());
109 Assert.Fail("Caught Exception : Failed!");
112 tlog.Debug(tag, $"XamlParseExceptionXmlInfo END");
117 [Description("XamlParseException UnformattedMessage ")]
118 [Property("SPEC", "Tizen.NUI.XamlParseException.UnformattedMessage A")]
119 [Property("SPEC_URL", "-")]
120 [Property("CRITERIA", "PRW")]
121 public void XamlParseExceptionUnformattedMessage()
123 tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage START");
127 var result = xamlParse.UnformattedMessage;
128 tlog.Debug(tag, "UnformattedMessage : " + result);
132 tlog.Debug(tag, e.Message.ToString());
133 Assert.Fail("Caught Exception : Failed!");
136 tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage END");