1 using NUnit.Framework;
5 namespace Tizen.NUI.Devel.Tests
7 using tlog = Tizen.Log;
10 [Description("internal/Xaml/MarkupExpressionParser")]
11 public class InternalXamlMarkupExpressionParserTest
13 private const string tag = "NUITEST";
14 private MarkupExpressionParserImplement m1;
19 tlog.Info(tag, "Init() is called!");
20 m1 = new MarkupExpressionParserImplement();
27 tlog.Info(tag, "Destroy() is called!");
30 private class MarkupExpressionParserImplement : MarkupExpressionParser
32 protected override void SetPropertyValue(string prop, string strValue, object value, IServiceProvider serviceProvider)
37 public void CallHandleProperty()
39 IServiceProviderImplement serviceProviderImplement = new IServiceProviderImplement();
40 string s1 = new string('a', 1);
41 HandleProperty("length", serviceProviderImplement, ref s1, true);
44 public void CallGetNextPiece()
46 string s1 = new string('a', 4);
48 GetNextPiece(ref s1, out char next);
52 public class IServiceProviderImplement : IServiceProvider
54 public object GetService(Type serviceType)
62 [Description("MarkupExpressionParser ParseExpression")]
63 [Property("SPEC", "Tizen.NUI.MarkupExpressionParser.ParseExpression M")]
64 [Property("SPEC_URL", "-")]
65 [Property("CRITERIA", "MR")]
66 public void MarkupExpressionParserParseExpression()
68 tlog.Debug(tag, $"MarkupExpressionParserParseExpression START");
72 string s1 = new string('a', 4);
74 IServiceProviderImplement serviceProviderImplement = new IServiceProviderImplement();
75 m1.ParseExpression(ref s1, serviceProviderImplement);
79 tlog.Debug(tag, e.Message.ToString());
80 tlog.Debug(tag, $"MarkupExpressionParserParseExpression END (OK)");
81 Assert.Pass("Caught Exception : passed!");
87 [Description("MarkupExpressionParser MatchMarkup")]
88 [Property("SPEC", "Tizen.NUI.MarkupExpressionParser.MatchMarkup M")]
89 [Property("SPEC_URL", "-")]
90 [Property("CRITERIA", "MR")]
91 public void MarkupExpressionParserMatchMarkup()
93 tlog.Debug(tag, $"MarkupExpressionParserMatchMarkup START");
97 string s1 = new string('a', 1);
98 MarkupExpressionParser.MatchMarkup(out s1, "a+b", out int i1);
102 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
103 Assert.Fail("Caught Exception" + e.ToString());
106 tlog.Debug(tag, $"MarkupExpressionParserMatchMarkup END (OK)");
107 Assert.Pass("MarkupExpressionParserMatchMarkup");
112 [Description("MarkupExpressionParser HandleProperty")]
113 [Property("SPEC", "Tizen.NUI.MarkupExpressionParser.HandleProperty M")]
114 [Property("SPEC_URL", "-")]
115 [Property("CRITERIA", "MR")]
116 public void MarkupExpressionParserHandleProperty()
118 tlog.Debug(tag, $"MarkupExpressionParserHandleProperty START");
122 m1.CallHandleProperty();
126 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
127 Assert.Fail("Caught Exception" + e.ToString());
130 tlog.Debug(tag, $"MarkupExpressionParserHandleProperty END (OK)");
131 Assert.Pass("MarkupExpressionParserHandleProperty");
136 [Description("MarkupExpressionParser GetNextPiece")]
137 [Property("SPEC", "Tizen.NUI.MarkupExpressionParser.GetNextPiece M")]
138 [Property("SPEC_URL", "-")]
139 [Property("CRITERIA", "MR")]
140 public void MarkupExpressionParserGetNextPiece()
142 tlog.Debug(tag, $"MarkupExpressionParserGetNextPiece START");
146 m1.CallGetNextPiece();
150 tlog.Debug(tag, e.Message.ToString());
151 tlog.Debug(tag, $"MarkupExpressionParserGetNextPiece END (OK)");
152 Assert.Pass("Caught Exception : passed!");