Skip to content

Commit 325175b

Browse files
committed
Migration to pattern matching
1 parent b2633db commit 325175b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DotNext.Tests/DelegateHelpersTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ public static void TryInvokeFunc()
149149
static MethodInfo GetMethod(int argCount)
150150
{
151151
const BindingFlags flags = BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly;
152-
return Single(typeof(Func).GetMethods(flags), candidate => candidate.Name == nameof(Func.TryInvoke) && candidate.GetParameters().Length == argCount + 1);
152+
return Single(typeof(Func).GetMethods(flags),
153+
candidate => candidate.Name is nameof(Func.TryInvoke) && candidate.GetParameters().Length == argCount + 1);
153154
}
154155

155156
var successValue = Expression.Constant(42, typeof(int));
@@ -611,7 +612,7 @@ static MethodInfo GetMethod(int argCount)
611612
{
612613
const BindingFlags flags = BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly;
613614
return Single(typeof(DelegateHelpers).GetMethods(flags),
614-
candidate => candidate.Name == nameof(DelegateHelpers.TryInvoke) && candidate.GetParameters().Length == argCount + 1);
615+
candidate => candidate.Name is nameof(DelegateHelpers.TryInvoke) && candidate.GetParameters().Length == argCount + 1);
615616
}
616617

617618
var successValue = Expression.Empty();

0 commit comments

Comments
 (0)