using MonoTests.System.ActivatorTestInternal;
+ class CustomUserType : Type
+ {
+ public override Assembly Assembly
+ {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override string AssemblyQualifiedName
+ {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override Type BaseType
+ {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override string FullName
+ {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override Guid GUID
+ {
+ get { throw new NotImplementedException (); }
+ }
+
+ protected override TypeAttributes GetAttributeFlagsImpl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Type GetElementType ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override EventInfo[] GetEvents (BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override FieldInfo GetField (string name, BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override FieldInfo[] GetFields (BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Type GetInterface (string name, bool ignoreCase)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Type[] GetInterfaces ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MethodInfo[] GetMethods (BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Type GetNestedType (string name, BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Type[] GetNestedTypes (BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override PropertyInfo[] GetProperties (BindingFlags bindingAttr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override bool HasElementTypeImpl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override bool IsArrayImpl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override bool IsByRefImpl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override bool IsCOMObjectImpl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override bool IsPointerImpl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override bool IsPrimitiveImpl ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Module Module
+ {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override string Namespace
+ {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override Type UnderlyingSystemType
+ {
+ get {
+ return this;
+ }
+ }
+
+ public override object[] GetCustomAttributes (Type attributeType, bool inherit)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override object[] GetCustomAttributes (bool inherit)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool IsDefined (Type attributeType, bool inherit)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string Name
+ {
+ get { throw new NotImplementedException (); }
+ }
+ }
+
+
[TestFixture]
public class ActivatorTest {
Activator.CreateInstance ((Type)null);
}
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void CreateInstance_CustomType ()
+ {
+ Activator.CreateInstance (new CustomUserType ());
+ }
+
[Test]
public void CreateInstance_StringString ()
{