diff --git a/Tests/CSharp/ExpressionTests/ByRefTests.cs b/Tests/CSharp/ExpressionTests/ByRefTests.cs index 536d224b..72e8584e 100644 --- a/Tests/CSharp/ExpressionTests/ByRefTests.cs +++ b/Tests/CSharp/ExpressionTests/ByRefTests.cs @@ -913,4 +913,56 @@ public static void LogAndReset(ref int arg) }"); } + [Fact] + public async Task ExtensionMethodsRefPropertyParameterAsync() + { + await TestConversionVisualBasicToCSharpAsync(@" +Public Class ExtensionMethodsRefPropertyParameter + Public Property Number As Integer = 3 + Public Sub WithExtensionMethod() + Number.NegEx() + End Sub + Public Sub WithMethod() + Neg(Number) + End Sub +End Class + +Public Module MathEx + + Public Sub NegEx(ByRef num As Integer) + num = -num + End Sub + Public Sub Neg(ByRef num As Integer) + num = -num + End Sub +End Module", @" +public partial class ExtensionMethodsRefPropertyParameter +{ + public int Number { get; set; } = 3; + public void WithExtensionMethod() + { + int argnum = Number; + argnum.NegEx(); + Number = argnum; + } + public void WithMethod() + { + int argnum = Number; + MathEx.Neg(ref argnum); + Number = argnum; + } +} + +public static partial class MathEx +{ + public static void NegEx(this ref int num) + { + num = -num; + } + public static void Neg(ref int num) + { + num = -num; + } +}"); + } } \ No newline at end of file