public void Override_MultidimensionalArrayMethod_WithRuntimeTypes() { var type = AssembleType <DomainType> ( typeContext => { var overriddenMethod = NormalizingMemberInfoFromExpressionUtility.GetMethod((DomainType dt) => dt.TransformByteMultiDimensionalArray(null)); var multiplyMethod = NormalizingMemberInfoFromExpressionUtility.GetMethod(() => DomainType.MultiplyByteMultiDimensionalArray(null, 0)); var mutableMethod = typeContext.ProxyType.GetOrAddOverride(overriddenMethod); mutableMethod.SetBody(ctx => Expression.Call(multiplyMethod, ctx.PreviousBody, Expression.Constant(2))); }); var instance = (DomainType)Activator.CreateInstance(type); var array = new byte[, ] { { 1, 2, 3 }, { 4, 5, 6 } }; var result = instance.TransformByteMultiDimensionalArray(array); SkipDeletion(); Assert.That(result, Is.TypeOf <byte[, ]>()); Assert.That(result, Is.EqualTo(new byte[, ] { { 4, 6, 8 }, { 10, 12, 14 } })); }