[NUI] Update TCs of NUI.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Xaml / TSReflectionExtensions.cs
1 using NUnit.Framework;
2 using System;
3 using Tizen.NUI.Binding.Internals;
4
5 namespace Tizen.NUI.Devel.Tests
6 {
7     using tlog = Tizen.Log;
8
9     [TestFixture]
10     [Description("internal/Xaml/ReflectionExtensions")]
11     public class InternalReflectionExtensionsTest
12     {
13         private const string tag = "NUITEST";
14
15         [SetUp]
16         public void Init()
17         {
18             tlog.Info(tag, "Init() is called!");
19         }
20
21         [TearDown]
22         public void Destroy()
23         {
24             tlog.Info(tag, "Destroy() is called!");
25         }
26
27         internal class TypeImpl : Type
28         {
29             public override global::System.Reflection.Assembly Assembly => global::System.Reflection.Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory + "WeGanttGmTask.dll");
30             public override string AssemblyQualifiedName => null;
31             public override Type BaseType => null;
32             public override string FullName => null;
33             public override Guid GUID => new Guid("ebc600a9-4fa4-4bc4-88a9-0dd8d57f0076");
34             public override global::System.Reflection.Module Module => this.GetType().Module;
35             public override string Namespace => "http://www.w3school.com.cn/children/";
36             public override Type UnderlyingSystemType => null;
37             public override string Name => null;
38             public override global::System.Reflection.ConstructorInfo[] GetConstructors(global::System.Reflection.BindingFlags bindingAttr) { return null; }
39             public override object[] GetCustomAttributes(bool inherit) { return null; }
40             public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return null; }
41             public override Type GetElementType() { return null; }
42             public override global::System.Reflection.EventInfo GetEvent(string name, global::System.Reflection.BindingFlags bindingAttr) { return null; }
43             public override global::System.Reflection.EventInfo[] GetEvents(global::System.Reflection.BindingFlags bindingAttr) { return null; }
44             public override global::System.Reflection.FieldInfo GetField(string name, global::System.Reflection.BindingFlags bindingAttr) { return null; }
45             public override global::System.Reflection.FieldInfo[] GetFields(global::System.Reflection.BindingFlags bindingAttr) { return null; }
46             public override Type GetInterface(string name, bool ignoreCase) { return null; }
47             public override Type[] GetInterfaces() { return null; }
48             public override global::System.Reflection.MemberInfo[] GetMembers(global::System.Reflection.BindingFlags bindingAttr) { return null; }
49             public override global::System.Reflection.MethodInfo[] GetMethods(global::System.Reflection.BindingFlags bindingAttr) { return null; }
50             public override Type GetNestedType(string name, global::System.Reflection.BindingFlags bindingAttr) { return null; }
51             public override Type[] GetNestedTypes(global::System.Reflection.BindingFlags bindingAttr) { return null; }
52             public override global::System.Reflection.PropertyInfo[] GetProperties(global::System.Reflection.BindingFlags bindingAttr) { return null; }
53             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) { return null; }
54             public override bool IsDefined(Type attributeType, bool inherit) { return true; }
55             protected override global::System.Reflection.TypeAttributes GetAttributeFlagsImpl() { return global::System.Reflection.TypeAttributes.Public; }
56             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) { return null; }
57             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) { return null; }
58             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) { return null; }
59             protected override bool HasElementTypeImpl() { return true; }
60             protected override bool IsArrayImpl() { return true; }
61             protected override bool IsByRefImpl() { return true; }
62             protected override bool IsCOMObjectImpl() { return true; }
63             protected override bool IsPointerImpl() { return true; }
64             protected override bool IsPrimitiveImpl() { return true; }
65         }
66
67         [Test]
68         [Category("P1")]
69         [Description("ReflectionExtensions GetFields")]
70         [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetFields M")]
71         [Property("SPEC_URL", "-")]
72         [Property("CRITERIA", "MR")]
73         public void ReflectionExtensionsGetFields()
74         {
75             tlog.Debug(tag, $"ReflectionExtensionsGetFields START");
76
77             try
78             {
79                 ReflectionExtensions.GetFields(new TypeImpl());
80             }
81             catch (Exception e)
82             {
83                 tlog.Debug(tag, e.Message.ToString());
84                 Assert.Fail("Caught Exception : Failed!");
85             }
86
87             tlog.Debug(tag, $"ReflectionExtensionsGetFields END");
88         }
89
90         [Test]
91         [Category("P1")]
92         [Description("ReflectionExtensions GetProperties")]
93         [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetProperties M")]
94         [Property("SPEC_URL", "-")]
95         [Property("CRITERIA", "MR")]
96         public void ReflectionExtensionsGetProperties()
97         {
98             tlog.Debug(tag, $"ReflectionExtensionsGetProperties START");
99
100             try
101             {
102                 ReflectionExtensions.GetProperties(new TypeImpl());
103             }
104             catch (Exception e)
105             {
106                 tlog.Debug(tag, e.Message.ToString());
107                 Assert.Fail("Caught Exception : Failed!");
108             }
109
110             tlog.Debug(tag, $"ReflectionExtensionsGetProperties END");
111         }
112     }
113 }