public void GetConstructor_With_Public_And_Private_Ctor() { var m = new TypeInformationManager(); var ctor1 = m.GetConstructor(typeof(Item), true); var ctor2 = m.GetConstructor(typeof(ItemWithPrivateCtor), false); var ctor3 = m.GetConstructor(typeof(ItemWithPrivateCtor), true); Assert.IsNotNull(ctor1); Assert.IsNull(ctor2); Assert.IsNotNull(ctor3); }
public void GetConstructor_Get_Empty_Ctor_Not_Ordered() { var m = new TypeInformationManager(); var ctor1 = m.GetConstructor(typeof(ItemWithMultiCtor), true); Assert.AreEqual(0, ctor1.GetParameters().Length); }
public void GetConstructor_Get_Preferred_Ctor() { var m = new TypeInformationManager(); var ctor1 = m.GetConstructor(typeof(ItemWithPreferredCtor), true); Assert.AreEqual(1, ctor1.GetParameters().Length); Assert.AreEqual(typeof(int), ctor1.GetParameters()[0].ParameterType); }