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");
76 [Description("XamlParseException XmlInfo ")]
77 [Property("SPEC", "Tizen.NUI.XamlParseException.XmlInfo A")]
78 [Property("SPEC_URL", "-")]
79 [Property("CRITERIA", "PRW")]
80 public void XamlParseExceptionXmlInfo()
82 tlog.Debug(tag, $"XamlParseExceptionXmlInfo START");
86 var result = (XmlLineInfoImpl)xamlParse.XmlInfo;
87 tlog.Debug(tag, "XmlInfo : " + result);
91 tlog.Debug(tag, e.Message.ToString());
92 Assert.Fail("Caught Exception : Failed!");
95 tlog.Debug(tag, $"XamlParseExceptionXmlInfo END");
100 [Description("XamlParseException UnformattedMessage ")]
101 [Property("SPEC", "Tizen.NUI.XamlParseException.UnformattedMessage A")]
102 [Property("SPEC_URL", "-")]
103 [Property("CRITERIA", "PRW")]
104 public void XamlParseExceptionUnformattedMessage()
106 tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage START");
110 var result = xamlParse.UnformattedMessage;
111 tlog.Debug(tag, "UnformattedMessage : " + result);
115 tlog.Debug(tag, e.Message.ToString());
116 Assert.Fail("Caught Exception : Failed!");
119 tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage END");