public void GetCustomAttributeData() { var customAttributes = new[] { CustomAttributeDeclarationObjectMother.Create() }; var member = MethodOnTypeInstantiationObjectMother.Create(); var parameter = CustomParameterInfoObjectMother.Create(member, customAttributes: customAttributes); var parameterInstantiation = new MemberParameterOnInstantiation(member, parameter); Assert.That(parameterInstantiation.GetCustomAttributeData(), Is.EqualTo(customAttributes)); }
public void SetUp() { _declaringType = TypeInstantiationObjectMother.Create(); _originalEvent = GetType().GetEvent("Event"); _addMethod = MethodOnTypeInstantiationObjectMother.Create(_declaringType, GetType().GetMethod("add_Event")); _removeMethod = MethodOnTypeInstantiationObjectMother.Create(_declaringType, GetType().GetMethod("remove_Event")); _raiseMethod = MethodOnTypeInstantiationObjectMother.Create(_declaringType, GetType().GetMethod("RaiseMethod")); _event = new EventOnTypeInstantiation(_declaringType, _originalEvent, _addMethod, _removeMethod, _raiseMethod); }
public void SetUp() { _indexParameter = CustomParameterInfoObjectMother.Create(); _declaringType = TypeInstantiationObjectMother.Create(); _getMethod = MethodOnTypeInstantiationObjectMother.Create(_declaringType, typeof(GenericType <>).GetMethod("get_Item")); _setMethod = MethodOnTypeInstantiationObjectMother.Create(_declaringType, typeof(GenericType <>).GetMethod("set_Item")); _originalProperty = CustomPropertyInfoObjectMother.Create( indexParameters: new[] { _indexParameter }, getMethod: _getMethod, setMethod: _setMethod); _property = new PropertyOnTypeInstantiation(_declaringType, _originalProperty, _getMethod, _setMethod); }
public void SetUp() { _typeArgument = ReflectionObjectMother.GetSomeType(); var genericTypeDefinition = typeof(GenericType <>); _genericTypeParameter = genericTypeDefinition.GetGenericArguments().Single(); _declaringType = TypeInstantiationObjectMother.Create(genericTypeDefinition, new[] { _typeArgument }); _memberOnTypeInstantiation = MethodOnTypeInstantiationObjectMother.Create(_declaringType); var genericMethodDefinition = NormalizingMemberInfoFromExpressionUtility.GetGenericMethodDefinition(() => GenericMethod <Dev.T>()); _genericMethodParameter = genericMethodDefinition.GetGenericArguments().Single(); _methodInstantiation = MethodInstantiationObjectMother.Create(genericMethodDefinition, typeArguments: new[] { _typeArgument }); }