1 using NUnit.Framework;
3 using Tizen.NUI.Binding.Internals;
5 namespace Tizen.NUI.Devel.Tests
7 using tlog = Tizen.Log;
10 [Description("internal/Xaml/ReflectionExtensions")]
11 internal class PublicReflectionExtensionsTest
13 private const string tag = "NUITEST";
18 tlog.Info(tag, "Init() is called!");
24 tlog.Info(tag, "Destroy() is called!");
27 private class TypeImplement : Type
29 public override global::System.Reflection.Assembly Assembly => throw new NotImplementedException();
31 public override string AssemblyQualifiedName => throw new NotImplementedException();
33 public override Type BaseType => throw new NotImplementedException();
35 public override string FullName => throw new NotImplementedException();
37 public override Guid GUID => throw new NotImplementedException();
39 public override global::System.Reflection.Module Module => throw new NotImplementedException();
41 public override string Namespace => throw new NotImplementedException();
43 public override Type UnderlyingSystemType => throw new NotImplementedException();
45 public override string Name => throw new NotImplementedException();
47 public override global::System.Reflection.ConstructorInfo[] GetConstructors(global::System.Reflection.BindingFlags bindingAttr)
49 throw new NotImplementedException();
52 public override object[] GetCustomAttributes(bool inherit)
54 throw new NotImplementedException();
57 public override object[] GetCustomAttributes(Type attributeType, bool inherit)
59 throw new NotImplementedException();
62 public override Type GetElementType()
64 throw new NotImplementedException();
67 public override global::System.Reflection.EventInfo GetEvent(string name, global::System.Reflection.BindingFlags bindingAttr)
69 throw new NotImplementedException();
72 public override global::System.Reflection.EventInfo[] GetEvents(global::System.Reflection.BindingFlags bindingAttr)
74 throw new NotImplementedException();
77 public override global::System.Reflection.FieldInfo GetField(string name, global::System.Reflection.BindingFlags bindingAttr)
79 throw new NotImplementedException();
82 public override global::System.Reflection.FieldInfo[] GetFields(global::System.Reflection.BindingFlags bindingAttr)
84 throw new NotImplementedException();
87 public override Type GetInterface(string name, bool ignoreCase)
89 throw new NotImplementedException();
92 public override Type[] GetInterfaces()
94 throw new NotImplementedException();
97 public override global::System.Reflection.MemberInfo[] GetMembers(global::System.Reflection.BindingFlags bindingAttr)
99 throw new NotImplementedException();
102 public override global::System.Reflection.MethodInfo[] GetMethods(global::System.Reflection.BindingFlags bindingAttr)
104 throw new NotImplementedException();
107 public override Type GetNestedType(string name, global::System.Reflection.BindingFlags bindingAttr)
109 throw new NotImplementedException();
112 public override Type[] GetNestedTypes(global::System.Reflection.BindingFlags bindingAttr)
114 throw new NotImplementedException();
117 public override global::System.Reflection.PropertyInfo[] GetProperties(global::System.Reflection.BindingFlags bindingAttr)
119 throw new NotImplementedException();
122 public override object InvokeMember(string name, global::System.Reflection.BindingFlags invokeAttr, global::System.Reflection.Binder binder, object target, object[] args, global::System.Reflection.ParameterModifier[] modifiers, global::System.Globalization.CultureInfo culture, string[] namedParameters)
124 throw new NotImplementedException();
127 public override bool IsDefined(Type attributeType, bool inherit)
129 throw new NotImplementedException();
132 protected override global::System.Reflection.TypeAttributes GetAttributeFlagsImpl()
134 throw new NotImplementedException();
137 protected override global::System.Reflection.ConstructorInfo GetConstructorImpl(global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, global::System.Reflection.CallingConventions callConvention, Type[] types, global::System.Reflection.ParameterModifier[] modifiers)
139 throw new NotImplementedException();
142 protected override global::System.Reflection.MethodInfo GetMethodImpl(string name, global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, global::System.Reflection.CallingConventions callConvention, Type[] types, global::System.Reflection.ParameterModifier[] modifiers)
144 throw new NotImplementedException();
147 protected override global::System.Reflection.PropertyInfo GetPropertyImpl(string name, global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, Type returnType, Type[] types, global::System.Reflection.ParameterModifier[] modifiers)
149 throw new NotImplementedException();
152 protected override bool HasElementTypeImpl()
154 throw new NotImplementedException();
157 protected override bool IsArrayImpl()
159 throw new NotImplementedException();
162 protected override bool IsByRefImpl()
164 throw new NotImplementedException();
167 protected override bool IsCOMObjectImpl()
169 throw new NotImplementedException();
172 protected override bool IsPointerImpl()
174 throw new NotImplementedException();
177 protected override bool IsPrimitiveImpl()
179 throw new NotImplementedException();
185 [Description("ReflectionExtensions GetField")]
186 [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetField M")]
187 [Property("SPEC_URL", "-")]
188 [Property("CRITERIA", "MR")]
189 public void ReflectionExtensionsGetField()
191 tlog.Debug(tag, $"ReflectionExtensionsGetField START");
195 TypeImplement type = new TypeImplement();
197 ReflectionExtensions.GetField(type, "myName");
201 tlog.Debug(tag, e.Message.ToString());
202 tlog.Debug(tag, $"ReflectionExtensionsGetField END (OK)");
203 Assert.Pass("Caught Exception : passed!");
209 [Description("ReflectionExtensions GetFields")]
210 [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetFields M")]
211 [Property("SPEC_URL", "-")]
212 [Property("CRITERIA", "MR")]
213 public void ReflectionExtensionsGetFields()
215 tlog.Debug(tag, $"ReflectionExtensionsGetFields START");
219 TypeImplement type = new TypeImplement();
221 ReflectionExtensions.GetFields(type);
225 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
226 Assert.Fail("Caught Exception" + e.ToString());
229 tlog.Debug(tag, $"ReflectionExtensionsGetFields END (OK)");
230 Assert.Pass("ReflectionExtensionsGetFields");
235 [Description("ReflectionExtensions GetProperties")]
236 [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetProperties M")]
237 [Property("SPEC_URL", "-")]
238 [Property("CRITERIA", "MR")]
239 public void ReflectionExtensionsGetProperties()
241 tlog.Debug(tag, $"ReflectionExtensionsGetProperties START");
245 TypeImplement type = new TypeImplement();
247 ReflectionExtensions.GetProperties(type);
251 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
252 Assert.Fail("Caught Exception" + e.ToString());
255 tlog.Debug(tag, $"ReflectionExtensionsGetProperties END (OK)");
256 Assert.Pass("ReflectionExtensionsGetProperties");
261 [Description("ReflectionExtensions GetProperty")]
262 [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetProperty M")]
263 [Property("SPEC_URL", "-")]
264 [Property("CRITERIA", "MR")]
265 public void ReflectionExtensionsGetProperty()
267 tlog.Debug(tag, $"ReflectionExtensionsGetProperty START");
271 TypeImplement type = new TypeImplement();
273 ReflectionExtensions.GetProperty(type, "myName");
277 tlog.Debug(tag, e.Message.ToString());
278 tlog.Debug(tag, $"ReflectionExtensionsGetProperty END (OK)");
279 Assert.Pass("Caught Exception : passed!");
285 [Description("ReflectionExtensions IsAssignableFrom")]
286 [Property("SPEC", "Tizen.NUI.ReflectionExtensions.IsAssignableFrom M")]
287 [Property("SPEC_URL", "-")]
288 [Property("CRITERIA", "MR")]
289 public void ReflectionExtensionsIsAssignableFrom()
291 tlog.Debug(tag, $"ReflectionExtensionsIsAssignableFrom START");
295 TypeImplement type = new TypeImplement();
296 TypeImplement c = new TypeImplement();
298 ReflectionExtensions.IsAssignableFrom(type, c);
302 tlog.Debug(tag, e.Message.ToString());
303 tlog.Debug(tag, $"ReflectionExtensionsIsAssignableFrom END (OK)");
304 Assert.Pass("Caught Exception : passed!");
310 [Description("ReflectionExtensions IsInstanceOfType")]
311 [Property("SPEC", "Tizen.NUI.ReflectionExtensions.IsInstanceOfType M")]
312 [Property("SPEC_URL", "-")]
313 [Property("CRITERIA", "MR")]
314 public void ReflectionExtensionsIsInstanceOfType()
316 tlog.Debug(tag, $"ReflectionExtensionsIsInstanceOfType START");
320 TypeImplement type = new TypeImplement();
321 object o1 = new object();
323 ReflectionExtensions.IsInstanceOfType(type, o1);
327 tlog.Debug(tag, e.Message.ToString());
328 tlog.Debug(tag, $"ReflectionExtensionsIsInstanceOfType END (OK)");
329 Assert.Pass("Caught Exception : passed!");