/mcs/class/corlib/Test/System/TypeTest.cs
C# | 4513 lines | 3837 code | 625 blank | 51 comment | 77 complexity | 2a5701da121846a8b9ef71f14a9b6932 MD5 | raw file
Possible License(s): Unlicense, Apache-2.0, LGPL-2.0, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0, GPL-2.0
Large files files are truncated, but you can click here to view the full file
- // TypeTest.cs - NUnit Test Cases for the System.Type class
- //
- // Authors:
- // Zoltan Varga (vargaz@freemail.hu)
- // Patrik Torstensson
- //
- // (C) 2003 Ximian, Inc. http://www.ximian.com
- //
- using NUnit.Framework;
- using System;
- using System.Threading;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Reflection;
- #if !MONOTOUCH
- using System.Reflection.Emit;
- #endif
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Globalization;
- class NoNamespaceClass {
- }
- namespace MonoTests.System
- {
- class Super : ICloneable
- {
- public virtual object Clone ()
- {
- return null;
- }
- }
- class Duper: Super
- {
- }
- interface IFace1
- {
- void foo ();
- }
- interface IFace2 : IFace1
- {
- void bar ();
- }
- interface IFace3 : IFace2
- {
- }
- enum TheEnum
- {
- A,
- B,
- C
- };
- abstract class Base
- {
- public int level;
- public abstract int this [byte i] {
- get;
- }
- public abstract int this [int i] {
- get;
- }
- public abstract void TestVoid ();
- public abstract void TestInt (int i);
- }
- class DeriveVTable : Base
- {
- public override int this [byte i] {
- get { return 1; }
- }
- public override int this [int i] {
- get { return 1; }
- }
- public override void TestVoid ()
- {
- level = 1;
- }
- public override void TestInt (int i)
- {
- level = 1;
- }
- }
- class NewVTable : DeriveVTable
- {
- public new int this [byte i] {
- get { return 2; }
- }
- public new int this [int i] {
- get { return 2; }
- }
- public new void TestVoid ()
- {
- level = 2;
- }
- public new void TestInt (int i)
- {
- level = 2;
- }
- public void Overload ()
- {
- }
- public void Overload (int i)
- {
- }
- public NewVTable (out int i)
- {
- i = 0;
- }
- public void byref_method (out int i)
- {
- i = 0;
- }
- }
- class Base1
- {
- public virtual int Foo {
- get { return 1; }
- set { }
- }
- }
- class Derived1 : Base1
- {
- public override int Foo {
- set { }
- }
- }
- class Derived2 : Base1
- {
- public new int Foo {
- get { return 1; }
- set { }
- }
- }
- public class Foo<T>
- {
- public T Whatever;
-
- public T Test {
- get { throw new NotImplementedException (); }
- }
- public T Execute (T a)
- {
- return a;
- }
-
- public class Nested<K> {}
- }
-
- class Foo<T, U>
- {
- }
- public interface IBar<T>
- {
- }
- public class Baz<T> : IBar<T>
- {
- }
- class Gazonk {
- public static void Bang<S> () {}
- }
- public class Bug348522
- {
- public void Test (int __argument)
- {
- }
- }
- public class FirstMethodBinder : Binder
- {
- public override MethodBase BindToMethod (BindingFlags bindingAttr, MethodBase [] match, ref object [] args,
- ParameterModifier [] modifiers, CultureInfo culture, string [] names,
- out object state)
- {
- state = null;
- return match [0];
- }
-
- public override object ChangeType (object value, Type type1, CultureInfo culture)
- {
- return value;
- }
-
- // The rest is just to please the compiler
- public override FieldInfo BindToField (BindingFlags a, FieldInfo[] b, object c, CultureInfo d)
- {
- return null;
- }
-
- public override void ReorderArgumentArray(ref object[] a, object b)
- {
- }
-
- public override MethodBase SelectMethod(BindingFlags a, MethodBase[] b, Type[] c, ParameterModifier[] d)
- {
- return null;
- }
-
- public override PropertyInfo SelectProperty(BindingFlags a, PropertyInfo[] b, Type c, Type[] d, ParameterModifier[] e)
- {
- return null;
- }
- }
- [TestFixture]
- public class TypeTest
- {
- #if !MONOTOUCH
- private ModuleBuilder module;
- #endif
- const string ASSEMBLY_NAME = "MonoTests.System.TypeTest";
- static int typeIndexer = 0;
- [SetUp]
- public void SetUp ()
- {
- AssemblyName assemblyName = new AssemblyName ();
- assemblyName.Name = ASSEMBLY_NAME;
- #if !MONOTOUCH
- var assembly = AppDomain.CurrentDomain.DefineDynamicAssembly (
- assemblyName, AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
- module = assembly.DefineDynamicModule ("module1");
- #endif
- }
- private string genTypeName ()
- {
- return "t" + (typeIndexer++);
- }
- private void ByrefMethod (ref int i, ref Derived1 j, ref Base1 k)
- {
- }
- public interface IFace {
- }
- private void GenericMethod<Q, T1> (Q q, T1 t) where T1 : IFace
- {
- }
- [Test]
- public void TestIsAssignableFrom ()
- {
- // Simple tests for inheritance
- Assert.AreEqual (typeof (Super).IsAssignableFrom (typeof (Duper)) , true, "#01");
- Assert.AreEqual (typeof (Duper).IsAssignableFrom (typeof (Duper)), true, "#02");
- Assert.AreEqual (typeof (Object).IsAssignableFrom (typeof (Duper)), true, "#03");
- Assert.AreEqual (typeof (ICloneable).IsAssignableFrom (typeof (Duper)), true, "#04");
- // Tests for arrays
- Assert.AreEqual (typeof (Super[]).IsAssignableFrom (typeof (Duper[])), true, "#05");
- Assert.AreEqual (typeof (Duper[]).IsAssignableFrom (typeof (Super[])), false, "#06");
- Assert.AreEqual (typeof (Object[]).IsAssignableFrom (typeof (Duper[])), true, "#07");
- Assert.AreEqual (typeof (ICloneable[]).IsAssignableFrom (typeof (Duper[])), true, "#08");
- // Tests for multiple dimensional arrays
- Assert.AreEqual (typeof (Super[][]).IsAssignableFrom (typeof (Duper[][])), true, "#09");
- Assert.AreEqual (typeof (Duper[][]).IsAssignableFrom (typeof (Super[][])), false, "#10");
- Assert.AreEqual (typeof (Object[][]).IsAssignableFrom (typeof (Duper[][])), true, "#11");
- Assert.AreEqual (typeof (ICloneable[][]).IsAssignableFrom (typeof (Duper[][])), true, "#12");
- // Tests for vectors<->one dimensional arrays */
- #if TARGET_JVM // Lower bounds arrays are not supported for TARGET_JVM.
- Array arr1 = Array.CreateInstance (typeof (int), new int[] {1});
- Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
- #else
- Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0});
- Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10});
- Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
- Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr2.GetType ()), false, "#14");
- #endif // TARGET_JVM
- // Test that arrays of enums can be cast to their base types
- Assert.AreEqual (typeof (int[]).IsAssignableFrom (typeof (TypeCode[])), true, "#15");
- // Test that arrays of valuetypes can't be cast to arrays of
- // references
- Assert.AreEqual (typeof (object[]).IsAssignableFrom (typeof (TypeCode[])), false, "#16");
- Assert.AreEqual (typeof (ValueType[]).IsAssignableFrom (typeof (TypeCode[])), false, "#17");
- Assert.AreEqual (typeof (Enum[]).IsAssignableFrom (typeof (TypeCode[])), false, "#18");
- // Test that arrays of enums can't be cast to arrays of references
- Assert.AreEqual (typeof (object[]).IsAssignableFrom (typeof (TheEnum[])), false, "#19");
- Assert.AreEqual (typeof (ValueType[]).IsAssignableFrom (typeof (TheEnum[])), false, "#20");
- Assert.AreEqual (typeof (Enum[]).IsAssignableFrom (typeof (TheEnum[])), false, "#21");
- // Check that ValueType and Enum are recognized as reference types
- Assert.AreEqual (typeof (object).IsAssignableFrom (typeof (ValueType)), true, "#22");
- Assert.AreEqual (typeof (object).IsAssignableFrom (typeof (Enum)), true, "#23");
- Assert.AreEqual (typeof (ValueType).IsAssignableFrom (typeof (Enum)), true, "#24");
- Assert.AreEqual (typeof (object[]).IsAssignableFrom (typeof (ValueType[])), true, "#25");
- Assert.AreEqual (typeof (ValueType[]).IsAssignableFrom (typeof (ValueType[])), true, "#26");
- Assert.AreEqual (typeof (Enum[]).IsAssignableFrom (typeof (ValueType[])), false, "#27");
- Assert.AreEqual (typeof (object[]).IsAssignableFrom (typeof (Enum[])), true, "#28");
- Assert.AreEqual (typeof (ValueType[]).IsAssignableFrom (typeof (Enum[])), true, "#29");
- Assert.AreEqual (typeof (Enum[]).IsAssignableFrom (typeof (Enum[])), true, "#30");
- // Tests for byref types
- MethodInfo mi = typeof (TypeTest).GetMethod ("ByrefMethod", BindingFlags.Instance|BindingFlags.NonPublic);
- Assert.IsTrue (mi.GetParameters ()[2].ParameterType.IsAssignableFrom (mi.GetParameters ()[1].ParameterType));
- Assert.IsTrue (mi.GetParameters ()[1].ParameterType.IsAssignableFrom (mi.GetParameters ()[1].ParameterType));
- // Tests for type parameters
- mi = typeof (TypeTest).GetMethod ("GenericMethod", BindingFlags.Instance|BindingFlags.NonPublic);
- Assert.IsTrue (mi.GetParameters ()[0].ParameterType.IsAssignableFrom (mi.GetParameters ()[0].ParameterType));
- Assert.IsFalse (mi.GetParameters ()[0].ParameterType.IsAssignableFrom (typeof (int)));
- // Tests for parameters with generic constraints
- mi = typeof (TypeTest).GetMethod ("GenericMethod", BindingFlags.Instance|BindingFlags.NonPublic);
- Assert.IsTrue (typeof (IFace).IsAssignableFrom (mi.GetParameters ()[1].ParameterType));
- }
- [Test]
- [ExpectedException (typeof (ArgumentException))]
- public void GetInterfaceMapOnInterface ()
- {
- typeof (IList).GetInterfaceMap (typeof (ICollection));
- }
- [Test]
- public void TestIsSubclassOf ()
- {
- Assert.IsTrue (typeof (ICloneable).IsSubclassOf (typeof (object)), "#01");
- // Tests for byref types
- Type paramType = typeof (TypeTest).GetMethod ("ByrefMethod", BindingFlags.Instance|BindingFlags.NonPublic).GetParameters () [0].ParameterType;
- Assert.IsTrue (!paramType.IsSubclassOf (typeof (ValueType)), "#02");
- //Assert.IsTrue (paramType.IsSubclassOf (typeof (Object)), "#03");
- Assert.IsTrue (!paramType.IsSubclassOf (paramType), "#04");
- }
- [Test]
- public void TestGetMethodImpl ()
- {
- // Test binding of new slot methods (using no types)
- Assert.AreEqual (typeof (Base), typeof (Base).GetMethod("TestVoid").DeclaringType, "#01");
- Assert.AreEqual (typeof (NewVTable), typeof (NewVTable).GetMethod ("TestVoid").DeclaringType, "#02");
- // Test binding of new slot methods (using types)
- Assert.AreEqual (typeof (Base), typeof (Base).GetMethod ("TestInt", new Type[] { typeof (int) }).DeclaringType, "#03");
- Assert.AreEqual (typeof (NewVTable), typeof (NewVTable).GetMethod ("TestInt", new Type[] { typeof (int) }).DeclaringType, "#04");
- // Test overload resolution
- Assert.AreEqual (0, typeof (NewVTable).GetMethod ("Overload", new Type[0]).GetParameters ().Length, "#05");
- // Test byref parameters
- Assert.AreEqual (null, typeof (NewVTable).GetMethod ("byref_method", new Type[] { typeof (int) }), "#06");
- Type byrefInt = typeof (NewVTable).GetMethod ("byref_method").GetParameters ()[0].ParameterType;
- Assert.IsNotNull (typeof (NewVTable).GetMethod ("byref_method", new Type[] { byrefInt }), "#07");
- }
- [Test]
- [Category ("TargetJvmNotWorking")]
- public void TestGetPropertyImpl ()
- {
- // Test getting property that is exact
- Assert.AreEqual (typeof (NewVTable), typeof (NewVTable).GetProperty ("Item", new Type[1] { typeof (Int32) }).DeclaringType, "#01");
- // Test getting property that is not exact
- Assert.AreEqual (typeof (NewVTable), typeof (NewVTable).GetProperty ("Item", new Type[1] { typeof (Int16) }).DeclaringType, "#02");
- // Test overriding of properties when only the set accessor is overriden
- Assert.AreEqual (1, typeof (Derived1).GetProperties ().Length, "#03");
- }
- [Test]
- public void GetProperties ()
- {
- // Test hide-by-name-and-signature
- Assert.AreEqual (1, typeof (Derived2).GetProperties ().Length);
- Assert.AreEqual (typeof (Derived2), typeof (Derived2).GetProperties ()[0].DeclaringType);
- }
- [Test] // GetProperties (BindingFlags)
- public void GetProperties_Flags ()
- {
- PropertyInfo [] props;
- Type type = typeof (Bar);
- BindingFlags flags;
- flags = BindingFlags.Instance | BindingFlags.NonPublic;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#A1");
- Assert.IsTrue (ContainsProperty (props, "ProtInstBase"), "#A2");
- Assert.IsTrue (ContainsProperty (props, "ProIntInstBase"), "#A3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#A4");
- Assert.IsTrue (ContainsProperty (props, "IntInstBase"), "#A5");
- Assert.IsTrue (ContainsProperty (props, "PrivInst"), "#A6");
- Assert.IsTrue (ContainsProperty (props, "ProtInst"), "#A7");
- Assert.IsTrue (ContainsProperty (props, "ProIntInst"), "#A8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#A9");
- Assert.IsTrue (ContainsProperty (props, "IntInst"), "#A10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#A11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#A12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#A13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#A14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#A15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#A16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#A17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#A18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#A19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#A20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#A21");
- Assert.IsTrue (ContainsProperty (props, "ProtInstBlue"), "#A22");
- Assert.IsTrue (ContainsProperty (props, "ProIntInstBlue"), "#A23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#A24");
- Assert.IsTrue (ContainsProperty (props, "IntInstBlue"), "#A25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#A26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#A27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#A28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#A29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#A30");
- flags = BindingFlags.Instance | BindingFlags.Public;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#B1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#B2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#B3");
- Assert.IsTrue (ContainsProperty (props, "PubInstBase"), "#B4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#B5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#B6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#B7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#B8");
- Assert.IsTrue (ContainsProperty (props, "PubInst"), "#B9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#B10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#B11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#B12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#B13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#B14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#B15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#B16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#B17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#B18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#B19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#B20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#B21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#B22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#B23");
- Assert.IsTrue (ContainsProperty (props, "PubInstBlue"), "#B24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#B25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#B26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#B27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#B28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#B29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#B30");
- flags = BindingFlags.Static | BindingFlags.Public;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#C1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#C2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#C3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#C4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#C5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#C6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#C7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#C8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#C9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#C10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#C11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#C12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#C13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#C14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#C15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#C16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#C17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#C18");
- Assert.IsTrue (ContainsProperty (props, "PubStat"), "#C19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#C20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#C21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#C22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#C23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#C24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#C25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#C26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#C27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#C28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#C29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#C30");
- flags = BindingFlags.Static | BindingFlags.NonPublic;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#D1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#D2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#D3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#D4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#D5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#D6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#D7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#D8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#D9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#D10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#D11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#D12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#D13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#D14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#D15");
- Assert.IsTrue (ContainsProperty (props, "PrivStat"), "#D16");
- Assert.IsTrue (ContainsProperty (props, "ProtStat"), "#D17");
- Assert.IsTrue (ContainsProperty (props, "ProIntStat"), "#D18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#D19");
- Assert.IsTrue (ContainsProperty (props, "IntStat"), "#D20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#D21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#D22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#D23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#D24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#D25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#D26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#D27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#D28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#D29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#D30");
- flags = BindingFlags.Instance | BindingFlags.NonPublic |
- BindingFlags.FlattenHierarchy;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#E1");
- Assert.IsTrue (ContainsProperty (props, "ProtInstBase"), "#E2");
- Assert.IsTrue (ContainsProperty (props, "ProIntInstBase"), "#E3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#E4");
- Assert.IsTrue (ContainsProperty (props, "IntInstBase"), "#E5");
- Assert.IsTrue (ContainsProperty (props, "PrivInst"), "#E6");
- Assert.IsTrue (ContainsProperty (props, "ProtInst"), "#E7");
- Assert.IsTrue (ContainsProperty (props, "ProIntInst"), "#E8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#E9");
- Assert.IsTrue (ContainsProperty (props, "IntInst"), "#E10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#E11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#E12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#E13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#E14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#E15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#E16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#E17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#E18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#E19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#E20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#E21");
- Assert.IsTrue (ContainsProperty (props, "ProtInstBlue"), "#E22");
- Assert.IsTrue (ContainsProperty (props, "ProIntInstBlue"), "#E23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#E24");
- Assert.IsTrue (ContainsProperty (props, "IntInstBlue"), "#E25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#E26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#E27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#E28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#E29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#E30");
- flags = BindingFlags.Instance | BindingFlags.Public |
- BindingFlags.FlattenHierarchy;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#F1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#F2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#F3");
- Assert.IsTrue (ContainsProperty (props, "PubInstBase"), "#F4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#F5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#F6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#F7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#F8");
- Assert.IsTrue (ContainsProperty (props, "PubInst"), "#F9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#F10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#F11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#F12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#F13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#F14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#F15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#F16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#F17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#F18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#F19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#F20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#F21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#F22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#F23");
- Assert.IsTrue (ContainsProperty (props, "PubInstBlue"), "#F24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#F25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#F26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#F27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#F28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#F29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#F30");
- flags = BindingFlags.Static | BindingFlags.Public |
- BindingFlags.FlattenHierarchy;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#G1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#G2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#G3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#G4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#G5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#G6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#G7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#G8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#G9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#G10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#G11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#G12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#G13");
- Assert.IsTrue (ContainsProperty (props, "PubStatBase"), "#G14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#G15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#G16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#G17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#G18");
- Assert.IsTrue (ContainsProperty (props, "PubStat"), "#G19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#G20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#G21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#G22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#G23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#G24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#G25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#G26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#G27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#G28");
- Assert.IsTrue (ContainsProperty (props, "PubStatBlue"), "#G29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#G30");
- flags = BindingFlags.Static | BindingFlags.NonPublic |
- BindingFlags.FlattenHierarchy;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#H1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#H2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#H3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#H4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#H5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#H6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#H7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#H8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#H9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#H10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#H11");
- Assert.IsTrue (ContainsProperty (props, "ProtStatBase"), "#H12");
- Assert.IsTrue (ContainsProperty (props, "ProIntStatBase"), "#H13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#H14");
- Assert.IsTrue (ContainsProperty (props, "IntStatBase"), "#H15");
- Assert.IsTrue (ContainsProperty (props, "PrivStat"), "#H16");
- Assert.IsTrue (ContainsProperty (props, "ProtStat"), "#H17");
- Assert.IsTrue (ContainsProperty (props, "ProIntStat"), "#H18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#H19");
- Assert.IsTrue (ContainsProperty (props, "IntStat"), "#H20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#H21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#H22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#H23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#H24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#H25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#H26");
- Assert.IsTrue (ContainsProperty (props, "ProtStatBlue"), "#H27");
- Assert.IsTrue (ContainsProperty (props, "ProIntStatBlue"), "#H28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#H29");
- Assert.IsTrue (ContainsProperty (props, "IntStatBlue"), "#H30");
- flags = BindingFlags.Instance | BindingFlags.NonPublic |
- BindingFlags.DeclaredOnly;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#I1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#I2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#I3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#I4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#I5");
- Assert.IsTrue (ContainsProperty (props, "PrivInst"), "#I6");
- Assert.IsTrue (ContainsProperty (props, "ProtInst"), "#I7");
- Assert.IsTrue (ContainsProperty (props, "ProIntInst"), "#I8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#I9");
- Assert.IsTrue (ContainsProperty (props, "IntInst"), "#I10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#I11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#I12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#I13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#I14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#I15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#I16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#I17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#I18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#I19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#I20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#I21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#I22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#I23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#I24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#I25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#I26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#I27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#I28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#I29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#I30");
- flags = BindingFlags.Instance | BindingFlags.Public |
- BindingFlags.DeclaredOnly;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#J1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#J2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#J3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#J4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#J5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#J6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#J7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#J8");
- Assert.IsTrue (ContainsProperty (props, "PubInst"), "#J9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#J10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#J11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#J12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#J13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#J14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#J15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#J16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#J17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#J18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#J19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#J20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#J21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#J22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#J23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#J24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#J25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#J26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#J27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#J28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#J29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#J30");
- flags = BindingFlags.Static | BindingFlags.Public |
- BindingFlags.DeclaredOnly;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#K1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#K2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#K3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#K4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#K5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#K6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#K7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#K8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#K9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#K10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#K11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#K12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#K13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#K14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#K15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#K16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#K17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#K18");
- Assert.IsTrue (ContainsProperty (props, "PubStat"), "#K19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#K20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#K21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#K22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#K23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#K24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#K25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#K26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#K27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#K28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#K29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#K30");
- flags = BindingFlags.Static | BindingFlags.NonPublic |
- BindingFlags.DeclaredOnly;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#L1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#L2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#L3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#L4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#L5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#L6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#L7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#L8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#L9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#L10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#L11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#L12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#L13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#L14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#L15");
- Assert.IsTrue (ContainsProperty (props, "PrivStat"), "#L16");
- Assert.IsTrue (ContainsProperty (props, "ProtStat"), "#L17");
- Assert.IsTrue (ContainsProperty (props, "ProIntStat"), "#L18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#L19");
- Assert.IsTrue (ContainsProperty (props, "IntStat"), "#L20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#L21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#L22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#L23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#L24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#L25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#L26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#L27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#L28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#L29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#L30");
- flags = BindingFlags.Instance | BindingFlags.NonPublic |
- BindingFlags.Public;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#M1");
- Assert.IsTrue (ContainsProperty (props, "ProtInstBase"), "#M2");
- Assert.IsTrue (ContainsProperty (props, "ProIntInstBase"), "#M3");
- Assert.IsTrue (ContainsProperty (props, "PubInstBase"), "#M4");
- Assert.IsTrue (ContainsProperty (props, "IntInstBase"), "#M5");
- Assert.IsTrue (ContainsProperty (props, "PrivInst"), "#M6");
- Assert.IsTrue (ContainsProperty (props, "ProtInst"), "#M7");
- Assert.IsTrue (ContainsProperty (props, "ProIntInst"), "#M8");
- Assert.IsTrue (ContainsProperty (props, "PubInst"), "#M9");
- Assert.IsTrue (ContainsProperty (props, "IntInst"), "#M10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#M11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#M12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#M13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#M14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#M15");
- Assert.IsFalse (ContainsProperty (props, "PrivStat"), "#M16");
- Assert.IsFalse (ContainsProperty (props, "ProtStat"), "#M17");
- Assert.IsFalse (ContainsProperty (props, "ProIntStat"), "#M18");
- Assert.IsFalse (ContainsProperty (props, "PubStat"), "#M19");
- Assert.IsFalse (ContainsProperty (props, "IntStat"), "#M20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#M21");
- Assert.IsTrue (ContainsProperty (props, "ProtInstBlue"), "#M22");
- Assert.IsTrue (ContainsProperty (props, "ProIntInstBlue"), "#M23");
- Assert.IsTrue (ContainsProperty (props, "PubInstBlue"), "#M24");
- Assert.IsTrue (ContainsProperty (props, "IntInstBlue"), "#M25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#M26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#M27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#M28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#M29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#M30");
- flags = BindingFlags.Static | BindingFlags.NonPublic |
- BindingFlags.Public;
- props = type.GetProperties (flags);
- Assert.IsFalse (ContainsProperty (props, "PrivInstBase"), "#N1");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBase"), "#N2");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBase"), "#N3");
- Assert.IsFalse (ContainsProperty (props, "PubInstBase"), "#N4");
- Assert.IsFalse (ContainsProperty (props, "IntInstBase"), "#N5");
- Assert.IsFalse (ContainsProperty (props, "PrivInst"), "#N6");
- Assert.IsFalse (ContainsProperty (props, "ProtInst"), "#N7");
- Assert.IsFalse (ContainsProperty (props, "ProIntInst"), "#N8");
- Assert.IsFalse (ContainsProperty (props, "PubInst"), "#N9");
- Assert.IsFalse (ContainsProperty (props, "IntInst"), "#N10");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBase"), "#N11");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBase"), "#N12");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBase"), "#N13");
- Assert.IsFalse (ContainsProperty (props, "PubStatBase"), "#N14");
- Assert.IsFalse (ContainsProperty (props, "IntStatBase"), "#N15");
- Assert.IsTrue (ContainsProperty (props, "PrivStat"), "#N16");
- Assert.IsTrue (ContainsProperty (props, "ProtStat"), "#N17");
- Assert.IsTrue (ContainsProperty (props, "ProIntStat"), "#N18");
- Assert.IsTrue (ContainsProperty (props, "PubStat"), "#N19");
- Assert.IsTrue (ContainsProperty (props, "IntStat"), "#N20");
- Assert.IsFalse (ContainsProperty (props, "PrivInstBlue"), "#N21");
- Assert.IsFalse (ContainsProperty (props, "ProtInstBlue"), "#N22");
- Assert.IsFalse (ContainsProperty (props, "ProIntInstBlue"), "#N23");
- Assert.IsFalse (ContainsProperty (props, "PubInstBlue"), "#N24");
- Assert.IsFalse (ContainsProperty (props, "IntInstBlue"), "#N25");
- Assert.IsFalse (ContainsProperty (props, "PrivStatBlue"), "#N26");
- Assert.IsFalse (ContainsProperty (props, "ProtStatBlue"), "#N27");
- Assert.IsFalse (ContainsProperty (props, "ProIntStatBlue"), "#N28");
- Assert.IsFalse (ContainsProperty (props, "PubStatBlue"), "#N29");
- Assert.IsFalse (ContainsProperty (props, "IntStatBlue"), "#N30");
- }
- [Test] // GetProperty (String)
- public void GetProperty1_Name_Null ()
- {
- Type type = typeof (Bar);
- try {
- type.GetProperty ((string) null);
- Assert.Fail ("#1");
- } catch (ArgumentNullException ex) {
- Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
- Assert.IsNull (ex.InnerException, "#3");
- Assert.IsNotNull (ex.Message, "#4");
- Assert.IsNotNull (ex.ParamName, "#5");
- Assert.AreEqual ("name", ex.ParamName, "#6");
- }
- }
- [Test] // GetProperty (String, BindingFlags)
- public void GetProperty2 ()
- {
- Type type = typeof (Bar);
- BindingFlags flags;
- flags = BindingFlags.Instance | BindingFlags.NonPublic;
- Assert.IsNull (type.GetProperty ("PrivInstBase", flags), "#A1");
- Assert.IsNotNull (type.GetProperty ("ProtInstBase", flags), "#A2");
- Assert.IsNotNull (type.GetProperty ("ProIntInstBase", flags), "#A3");
- Assert.IsNull (type.GetProperty ("PubInstBase", flags), "#A4");
- Assert.IsNotNull (type.GetProperty ("IntInstBase", flags), "#A5");
- Assert.IsNotNull (type.GetProperty ("PrivInst", flags), "#A6");
- Assert.IsNotNull (type.GetProperty ("ProtInst", flags), "#A7");
- Assert.IsNotNull (type.GetProperty ("ProIntInst", flags), "#A8");
- Assert.IsNull (type.GetProperty ("PubInst", flags), "#A9");
- Assert.IsNotNull (type.GetProperty ("IntInst", flags), "#A10");
- Assert.IsNull (type.GetProperty ("PrivStatBase", flags), "#A11");
- Assert.IsNull (type.GetProperty ("ProtStatBase", flags), "#A12");
- Assert.IsNull (type.GetProperty ("ProIntStatBase", flags), "#A13");
- Assert.IsNull (type.GetProperty ("PubStatBase", flags), "#A14");
- Assert.IsNull (type.GetProperty ("IntStatBase", flags), "#A15");
- Assert.IsNull (type.GetProperty ("PrivStat", flags), "#A16");
- Assert.IsNull (type.GetProperty ("ProtStat", flags), "#A17");
- Assert.IsNull (type.GetProperty ("ProIntStat", flags), "#A18");
- Assert.IsNull (type.GetProperty ("PubStat", flags), "#A19");
- Assert.IsNull (type.GetProperty ("IntStat", flags), "#A20");
- Assert.IsNull (type.GetProperty ("PrivInstBlue", flags), "#A21");
- Assert.IsNotNull (type.GetProperty ("ProtInstBlue", flags), "#A22");
- Assert.IsNotNull (type.GetProperty ("ProIntInstBlue", flags), "#A23");
- Assert.IsNull (type.GetProperty ("PubInstBlue", flags), "#A24");
- Assert.IsNotNull (type.GetProperty ("IntInstBlue", flags), "#A25");
- Assert.IsNull (type.GetProperty ("PrivStatBlue", flags), "#A26");
- Assert.IsNull (type.GetProperty ("ProtStatBlue", flags), "#A27");
- Assert.IsNull (type.GetProperty ("ProIntStatBlue", flags), "#A28");
- Assert.IsNull (type.GetProperty ("PubStatBlue", flags), "#A29");
- Assert.IsNull (type.GetProperty ("IntStatBlue", flags), "#A30");
- flags = BindingFlags.Instance | BindingFlags.Public;
- Assert.IsNull (type.GetProperty ("PrivInstBase", flags), "#B1");
- Assert.IsNull (type.GetProperty ("ProtInstBase", flags), "#B2");
- Assert.IsNull (type.GetProperty ("ProIntInstBase", flags), "#B3");
- Assert.IsNotNull (type.GetProperty ("PubInstBase", flags), "#B4");
- Assert.IsNull (type.GetProperty ("IntInstBase", flags), "#B5");
- Assert.IsNull (type.GetProperty ("PrivInst", flags), "#B6");
- Assert.IsNull (type.GetProperty ("ProtInst", flags), "#B7");
- Assert.IsNull (type.GetProperty ("ProIntInst", flags), "#B8");
- Assert.IsNotNull (type.GetProperty ("PubInst", flags), "#B9");
- Assert.IsNull (type.GetProperty ("IntInst", flags), "#B10");
- Assert.IsNull (type.GetProperty ("PrivStatBase", flags), "#B11");
- Assert.IsNull (type.GetProperty ("ProtStatBase", flags), "#B12");
- Assert.IsNull (type.GetProperty ("ProIntStatBase", flags), "#B13");
- Assert.IsNull (type.GetProperty ("PubStatBase", flags), "#B14");
- Assert.IsNull (type.GetProperty ("IntStatBase", flags), "#B15");
- Assert.IsNull (type.GetProperty ("PrivStat", flags), "#B16");
- Assert.IsNull (type.GetProperty ("ProtStat", flags), "#B17");
- Assert.IsNull (type.GetProperty ("ProIntStat", flags), "#B18");
- Assert.IsNull (type.GetProperty ("PubStat", flags), "#B19");
- Assert.IsNull (type.GetProperty ("IntStat", flags), "#B20");
- Assert.IsNull (type.GetProperty ("PrivInstBlue", flags), "#B21");
- Assert.IsNull (type.GetProperty ("ProtInstBlue", flags), "#B22");
- Assert.IsNull (type.GetProperty ("ProIntInstBlue", flags), "#B23");
- Assert.IsNotNull (type.GetProperty ("PubInstBlue", flags), "#B24");
- Assert.IsNull (type.GetProperty ("IntInstBlue", flags), "#B25");
- Assert.IsNull (type.GetProperty ("PrivStatBlue", flags), "#B26");
- Assert.IsNull (type.GetProperty ("ProtStatBlue", flags), "#B27");
- Assert.IsNull (type.GetProperty ("ProIntStatBlue", flags), "#B28");
- Assert.IsNull (type.GetProperty ("PubStatBlue", flags), "#B29");
- Assert.IsNull (type.GetProperty ("IntStatBlue", flags), "#B30");
- flags = BindingFlags.Static | BindingFlags.Public;
- Assert.IsNull (type.GetProperty ("PrivInstBase", flags), "#C1");
- Assert.IsNull (type.GetProperty ("ProtInstBase", flags), "#C2");
- Assert.IsNull (type.GetProperty ("ProIntInstBase", flags), "#C3");
- Assert.IsNull (type.GetProperty ("PubInstBase", flags), "#C4");
- Assert.IsNull (type.GetProperty ("IntInstBase", flags), "#C5");
- Assert.IsNull (type.GetProperty ("PrivInst", flags), "#C6");
- Assert.IsNull (type.GetProperty ("ProtInst", flags), "#C7");
- Assert.IsNull (type.GetProperty ("ProIntInst", flags), "#C8");
- Assert.IsNull (type.GetProperty ("PubInst", flags), "#C9");
- Assert.IsNull (type.GetProperty ("IntInst", flags), "#C10");
- Assert.IsNull (type.GetProperty ("PrivStatBase", flags), "#C11");
- Assert.IsNull (type.GetProperty ("ProtStatBase", flags), "#C12");
- Assert.IsNull (type.GetProperty ("ProIntStatBase", flags), "#C13");
- Assert.IsNull (type.GetProperty ("PubStatBase", flags), "#C14");
- Assert.IsNull (type.GetProperty ("IntStatBase", flags), "#C15");
- Assert.IsNull (type.GetProperty ("PrivStat", flags), "#C16");
- Assert.IsNull (type.GetProperty ("ProtStat", flags), "#C17");
- Assert.IsNull (type.GetProperty ("ProIntStat", flags), "#C18");
- Assert.IsNotNull (type.GetProperty ("PubStat", flags), "#C19");
- Assert.IsNull (type.GetProperty ("IntStat", flags), "#C20");
- Assert.IsNull (type.GetProperty ("PrivInstBlue", flags), "#C21");
- Assert.IsNull (type.GetProperty ("ProtInstBlue", flags), "#C22");
- Assert.IsNull (type.GetProperty ("ProIntInstBlue", flags), "#C23");
- Assert.IsNull (type.GetProperty ("PubInstBlue", flags), "#C24");
- Assert.IsNull (type.GetProperty ("IntInstBlue", flags), "#C25");
- Assert.IsNull (type.GetProperty ("PrivStatBlue", flags), "#C26");
- Assert.IsNull (type.GetProperty ("ProtStatBlue", flags), "#C27");
- Assert.IsNull (type.GetProperty ("ProIntStatBlue", flags), "#C28");
- Assert.IsNull (type.GetProperty ("PubStatBlue", flags), "#C29");
- Assert.IsNull (type.GetProperty ("IntStatBlue", flags), "#C30");
- flags = BindingFlags.Static | BindingFlags.NonPublic;
- Assert.IsNull (type.GetProperty ("PrivInstBase", flags), "#D1");
- Assert.IsNull (type.GetProperty ("ProtInstBase", flags), "#D2");
- Assert.IsNull (type.GetProperty ("ProIntInstBase", flags), "#D3");
- Assert.IsNull (type.GetProperty ("PubInstBase", flags), "#D4");
- Assert.IsNull (type.GetProperty ("IntInstBase", flags), "#D5");
- Assert.IsNull (type.GetProperty ("PrivInst", flags), "#D6");
- Assert.IsNull (type.GetProperty ("ProtInst", flags), "#D7");
- Assert.IsNull (type.GetProperty ("ProIntInst", flags), "#D8");
- Assert.IsNull (type.GetProperty ("PubInst", flags), "#D9");
- Assert.IsNull (type.GetProperty ("IntInst", flags), "#D10");
- Assert.IsNull (type.GetProperty ("PrivStatBase", flags), "#D11");
- Assert.IsNull (type.GetProperty ("ProtStatBase", flags), "#D12");
- Assert.IsNull (type.GetProperty ("ProIntStatBase", flags), "#D13");
- Assert.IsNull (type.GetProperty ("PubStatBase", flags), "#D14");
- Assert.IsNull (type.GetProperty ("IntStatBase", flags), "#D15");
- Assert.IsNotNull (type.GetProperty ("PrivStat", flags), "#D16");
- Assert.IsNotNull (type.GetProperty ("ProtStat", flags), "#D17");
- …
Large files files are truncated, but you can click here to view the full file