public ShimReplacement(ShimmedMember parent, Type returnType, bool isPassThrough = false) { Parent = parent ?? throw new ArgumentNullException(nameof(parent)); ReturnType = returnType ?? throw new ArgumentNullException(nameof(ReturnType)); IsPassThrough = isPassThrough; HasReturnValue = ShimmedMemberHelper.MemberCanReturn(parent.Member); if (HasReturnValue) { ReturnValue = ShimmedMemberHelper.GetDefaultValue(returnType); } }
public ShimmedConstructor(ConstructorInfo constructor) : base() { Init(constructor, constructor.DeclaringType, ShimmedMemberHelper.GetDefaultValue(constructor.DeclaringType)); }