1 using NUnit.Framework;
3 using System.Reflection;
6 namespace Tizen.NUI.Devel.Tests
8 using tlog = Tizen.Log;
11 [Description("public/xaml/XamlResourceIdAttribute ")]
12 internal class PublicXamlResourceIdAttributeTest
14 private const string tag = "NUITEST";
15 private static XamlResourceIdAttribute resourceIdAttribute;
19 tlog.Info(tag, "Init() is called!");
20 resourceIdAttribute = new XamlResourceIdAttribute("myId", "myPath", typeof(string));
26 resourceIdAttribute = null;
27 tlog.Info(tag, "Destroy() is called!");
32 [Description("XamlResourceIdAttribute XamlResourceIdAttribute")]
33 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.XamlResourceIdAttribute C")]
34 [Property("SPEC_URL", "-")]
35 [Property("CRITERIA", "CONSTR")]
36 public void XamlResourceIdAttributeConstructor()
38 tlog.Debug(tag, $"XamlResourceIdAttributeConstructor START");
40 XamlResourceIdAttribute x1 = new XamlResourceIdAttribute("myId", "myPath", typeof(string));
42 tlog.Debug(tag, $"XamlResourceIdAttributeConstructor END (OK)");
43 Assert.Pass("XamlResourceIdAttributeConstructor");
48 [Description("XamlResourceIdAttribute ResourceId")]
49 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.ResourceId A")]
50 [Property("SPEC_URL", "-")]
51 [Property("CRITERIA", "PRW")]
52 public void XamlResourceIdAttributeResourceId()
54 tlog.Debug(tag, $"XamlResourceIdAttributeResourceId START");
58 string s1 = resourceIdAttribute.ResourceId;
59 resourceIdAttribute.ResourceId = s1;
63 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
64 Assert.Fail("Caught Exception" + e.ToString());
67 tlog.Debug(tag, $"XamlResourceIdAttributeResourceId END (OK)");
68 Assert.Pass("XamlResourceIdAttributeResourceId");
73 [Description("XamlResourceIdAttribute Path")]
74 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.Path A")]
75 [Property("SPEC_URL", "-")]
76 [Property("CRITERIA", "PRW")]
77 public void XamlResourceIdAttributePath()
79 tlog.Debug(tag, $"XamlResourceIdAttributePath START");
83 string s1 = resourceIdAttribute.Path;
84 resourceIdAttribute.Path = s1;
88 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
89 Assert.Fail("Caught Exception" + e.ToString());
92 tlog.Debug(tag, $"XamlResourceIdAttributePath END (OK)");
93 Assert.Pass("XamlResourceIdAttributePath");
98 [Description("XamlResourceIdAttribute Type")]
99 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.Type A")]
100 [Property("SPEC_URL", "-")]
101 [Property("CRITERIA", "PRW")]
102 public void XamlResourceIdAttributeType()
104 tlog.Debug(tag, $"XamlResourceIdAttributeType START");
108 Type t1 = resourceIdAttribute.Type;
109 resourceIdAttribute.Type = t1;
113 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
114 Assert.Fail("Caught Exception" + e.ToString());
117 tlog.Debug(tag, $"XamlResourceIdAttributeType END (OK)");
118 Assert.Pass("XamlResourceIdAttributeType");
123 [Description("XamlResourceIdAttribute GetResourceIdForType")]
124 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetResourceIdForType M")]
125 [Property("SPEC_URL", "-")]
126 [Property("CRITERIA", "MR")]
127 public void XamlResourceIdAttributeGetResourceIdForType()
129 tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForType START");
133 XamlResourceIdAttribute.GetResourceIdForType(typeof(string));
137 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
138 Assert.Fail("Caught Exception" + e.ToString());
141 tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForType END (OK)");
142 Assert.Pass("XamlResourceIdAttributeGetResourceIdForType");
147 [Description("XamlResourceIdAttribute GetPathForType")]
148 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetPathForType M")]
149 [Property("SPEC_URL", "-")]
150 [Property("CRITERIA", "MR")]
151 public void XamlResourceIdAttributeGetPathForType()
153 tlog.Debug(tag, $"XamlResourceIdAttributeGetPathForType START");
157 XamlResourceIdAttribute.GetPathForType(typeof(string));
161 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
162 Assert.Fail("Caught Exception" + e.ToString());
165 tlog.Debug(tag, $"XamlResourceIdAttributeGetPathForType END (OK)");
166 Assert.Pass("XamlResourceIdAttributeGetPathForType");
169 private class AssemblyImplent : Assembly
171 public override object[] GetCustomAttributes(bool inherit)
179 [Description("XamlResourceIdAttribute GetTypeForResourceId")]
180 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetTypeForResourceId M")]
181 [Property("SPEC_URL", "-")]
182 [Property("CRITERIA", "MR")]
183 public void XamlResourceIdAttributeGetTypeForResourceId()
185 tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForResourceId START");
189 AssemblyImplent assembly = new AssemblyImplent();
190 XamlResourceIdAttribute.GetTypeForResourceId(assembly, "myResourceId");
194 tlog.Debug(tag, e.Message.ToString());
195 tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForResourceId END (OK)");
196 Assert.Pass("Caught Exception : passed!");
202 [Description("XamlResourceIdAttribute GetResourceIdForPath")]
203 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetResourceIdForPath M")]
204 [Property("SPEC_URL", "-")]
205 [Property("CRITERIA", "MR")]
206 public void XamlResourceIdAttributeGetResourceIdForPath()
208 tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath START");
212 AssemblyImplent assembly = new AssemblyImplent();
213 XamlResourceIdAttribute.GetResourceIdForPath(assembly, "myPath");
217 tlog.Debug(tag, e.Message.ToString());
218 tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath END (OK)");
219 Assert.Pass("Caught Exception : passed!");
225 [Description("XamlResourceIdAttribute GetTypeForPath")]
226 [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetTypeForPath M")]
227 [Property("SPEC_URL", "-")]
228 [Property("CRITERIA", "MR")]
229 public void XamlResourceIdAttributeGetTypeForPath()
231 tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForPath START");
235 AssemblyImplent assembly = new AssemblyImplent();
236 XamlResourceIdAttribute.GetTypeForPath(assembly, "myPath");
240 tlog.Debug(tag, e.Message.ToString());
241 tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForPath END (OK)");
242 Assert.Pass("Caught Exception : passed!");