@@ -2211,6 +2211,205 @@ public partial class FooBar : IFoo, IBar
22112211}" ) ;
22122212 }
22132213
2214+ [ Fact ]
2215+ public async Task ExplicitInterfaceImplementationRequiredMethodParameters_749_Async ( )
2216+ {
2217+ await TestConversionVisualBasicToCSharpAsync (
2218+ @"
2219+ Public Interface IFoo
2220+ Function DoFooBar(ByRef str As String, i As Integer) As Integer
2221+ End Interface
2222+
2223+ Public Interface IBar
2224+ Function DoFooBar(ByRef str As String, i As Integer) As Integer
2225+ End Interface
2226+
2227+ Public Class FooBar
2228+ Implements IFoo, IBar
2229+
2230+ Function Foo(ByRef str As String, i As Integer) As Integer Implements IFoo.DoFooBar
2231+ Return 4
2232+ End Function
2233+
2234+ Function Bar(ByRef str As String, i As Integer) As Integer Implements IBar.DoFooBar
2235+ Return 2
2236+ End Function
2237+
2238+ End Class" , @"
2239+ public partial interface IFoo
2240+ {
2241+ int DoFooBar(ref string str, int i);
2242+ }
2243+
2244+ public partial interface IBar
2245+ {
2246+ int DoFooBar(ref string str, int i);
2247+ }
2248+
2249+ public partial class FooBar : IFoo, IBar
2250+ {
2251+
2252+ public int Foo(ref string str, int i)
2253+ {
2254+ return 4;
2255+ }
2256+
2257+ int IFoo.DoFooBar(ref string str, int i) => Foo(ref str, i);
2258+
2259+ public int Bar(ref string str, int i)
2260+ {
2261+ return 2;
2262+ }
2263+
2264+ int IBar.DoFooBar(ref string str, int i) => Bar(ref str, i);
2265+
2266+ }
2267+ " ) ;
2268+ }
2269+
2270+ [ Fact ]
2271+ public async Task ExplicitInterfaceImplementationOptionalParameters_1062_Async ( )
2272+ {
2273+ await TestConversionVisualBasicToCSharpAsync (
2274+ @"
2275+ Public Interface InterfaceWithOptionalParameters
2276+ Sub S(Optional i As Integer = 0)
2277+ End Interface
2278+
2279+ Public Class ImplInterfaceWithOptionalParameters : Implements InterfaceWithOptionalParameters
2280+ Public Sub InterfaceWithOptionalParameters_S(Optional i As Integer = 0) Implements InterfaceWithOptionalParameters.S
2281+ End Sub
2282+ End Class" , @"
2283+ public partial interface InterfaceWithOptionalParameters
2284+ {
2285+ void S(int i = 0);
2286+ }
2287+
2288+ public partial class ImplInterfaceWithOptionalParameters : InterfaceWithOptionalParameters
2289+ {
2290+ public void InterfaceWithOptionalParameters_S(int i = 0)
2291+ {
2292+ }
2293+
2294+ void InterfaceWithOptionalParameters.S(int i = 0) => InterfaceWithOptionalParameters_S(i);
2295+ }
2296+ " ) ;
2297+ }
2298+
2299+
2300+ [ Fact ]
2301+ public async Task ExplicitInterfaceImplementationOptionalParametersAsync ( )
2302+ {
2303+ await TestConversionVisualBasicToCSharpAsync (
2304+ @"Public Interface IFoo
2305+ Property ExplicitProp(Optional str As String = """") As Integer
2306+ Function ExplicitFunc(Optional str2 As String = """", Optional i2 As Integer = 1) As Integer
2307+ End Interface
2308+
2309+ Public Class Foo
2310+ Implements IFoo
2311+
2312+ Private Function ExplicitFunc(Optional str As String = """", Optional i2 As Integer = 1) As Integer Implements IFoo.ExplicitFunc
2313+ Return 5
2314+ End Function
2315+
2316+ Private Property ExplicitProp(Optional str As String = """") As Integer Implements IFoo.ExplicitProp
2317+ Get
2318+ Return 5
2319+ End Get
2320+ Set(value As Integer)
2321+ End Set
2322+ End Property
2323+ End Class" , @"
2324+ public partial interface IFoo
2325+ {
2326+ int get_ExplicitProp(string str = """");
2327+ void set_ExplicitProp(string str = """", int value = default);
2328+ int ExplicitFunc(string str2 = """", int i2 = 1);
2329+ }
2330+
2331+ public partial class Foo : IFoo
2332+ {
2333+
2334+ private int ExplicitFunc(string str = """", int i2 = 1)
2335+ {
2336+ return 5;
2337+ }
2338+
2339+ int IFoo.ExplicitFunc(string str = """", int i2 = 1) => ExplicitFunc(str, i2);
2340+
2341+ private int get_ExplicitProp(string str = """")
2342+ {
2343+ return 5;
2344+ }
2345+
2346+ private void set_ExplicitProp(string str = """", int value = default)
2347+ {
2348+ }
2349+
2350+ int IFoo.get_ExplicitProp(string str = """") => get_ExplicitProp(str);
2351+ void IFoo.set_ExplicitProp(string str = """", int value = default) => set_ExplicitProp(str, value);
2352+ }
2353+ " ) ;
2354+ }
2355+
2356+
2357+ [ Fact ]
2358+ public async Task ExplicitInterfaceImplementationOptionalMethodParameters_749_Async ( )
2359+ {
2360+ await TestConversionVisualBasicToCSharpAsync (
2361+ @"
2362+ Public Interface IFoo
2363+ Function DoFooBar(ByRef str As String, Optional i As Integer = 4) As Integer
2364+ End Interface
2365+
2366+ Public Interface IBar
2367+ Function DoFooBar(ByRef str As String, Optional i As Integer = 8) As Integer
2368+ End Interface
2369+
2370+ Public Class FooBar
2371+ Implements IFoo, IBar
2372+
2373+ Function Foo(ByRef str As String, Optional i As Integer = 4) As Integer Implements IFoo.DoFooBar
2374+ Return 4
2375+ End Function
2376+
2377+ Function Bar(ByRef str As String, Optional i As Integer = 8) As Integer Implements IBar.DoFooBar
2378+ Return 2
2379+ End Function
2380+
2381+ End Class" , @"
2382+ public partial interface IFoo
2383+ {
2384+ int DoFooBar(ref string str, int i = 4);
2385+ }
2386+
2387+ public partial interface IBar
2388+ {
2389+ int DoFooBar(ref string str, int i = 8);
2390+ }
2391+
2392+ public partial class FooBar : IFoo, IBar
2393+ {
2394+
2395+ public int Foo(ref string str, int i = 4)
2396+ {
2397+ return 4;
2398+ }
2399+
2400+ int IFoo.DoFooBar(ref string str, int i = 4) => Foo(ref str, i);
2401+
2402+ public int Bar(ref string str, int i = 8)
2403+ {
2404+ return 2;
2405+ }
2406+
2407+ int IBar.DoFooBar(ref string str, int i = 8) => Bar(ref str, i);
2408+
2409+ }
2410+ " ) ;
2411+ }
2412+
22142413 [ Fact ]
22152414 public async Task RenamedInterfaceMethodFullyQualifiedAsync ( )
22162415 {
@@ -3506,62 +3705,6 @@ private void set_ExplicitProp(string str, int value)
35063705}" ) ;
35073706 }
35083707
3509- [ Fact ]
3510- public async Task ExplicitInterfaceImplementationOptionalParametersAsync ( )
3511- {
3512- await TestConversionVisualBasicToCSharpAsync (
3513- @"Public Interface IFoo
3514- Property ExplicitProp(Optional str As String = """") As Integer
3515- Function ExplicitFunc(Optional str2 As String = """", Optional i2 As Integer = 1) As Integer
3516- End Interface
3517-
3518- Public Class Foo
3519- Implements IFoo
3520-
3521- Private Function ExplicitFunc(Optional str As String = """", Optional i2 As Integer = 1) As Integer Implements IFoo.ExplicitFunc
3522- Return 5
3523- End Function
3524-
3525- Private Property ExplicitProp(Optional str As String = """") As Integer Implements IFoo.ExplicitProp
3526- Get
3527- Return 5
3528- End Get
3529- Set(value As Integer)
3530- End Set
3531- End Property
3532- End Class" , @"
3533- public partial interface IFoo
3534- {
3535- int get_ExplicitProp(string str = """");
3536- void set_ExplicitProp(string str = """", int value = default);
3537- int ExplicitFunc(string str2 = """", int i2 = 1);
3538- }
3539-
3540- public partial class Foo : IFoo
3541- {
3542-
3543- private int ExplicitFunc(string str = """", int i2 = 1)
3544- {
3545- return 5;
3546- }
3547-
3548- int IFoo.ExplicitFunc(string str, int i2) => ExplicitFunc(str, i2);
3549-
3550- private int get_ExplicitProp(string str = """")
3551- {
3552- return 5;
3553- }
3554-
3555- private void set_ExplicitProp(string str = """", int value = default)
3556- {
3557- }
3558-
3559- int IFoo.get_ExplicitProp(string str) => get_ExplicitProp(str);
3560- void IFoo.set_ExplicitProp(string str, int value) => set_ExplicitProp(str, value);
3561- }
3562- " ) ;
3563- }
3564-
35653708 /// <summary>
35663709 ///
35673710 /// </summary>
0 commit comments