Skip to content

Commit 1b8b31a

Browse files
Improve test to execute method
1 parent 40cdc10 commit 1b8b31a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test/Serilog.Settings.Configuration.Tests/StringArgumentValueTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public void StaticMembersAccessorsCanBeUsedForDelegateTypes(string input, Type t
113113
var actual = stringArgumentValue.ConvertTo(targetType, new ResolutionContext());
114114

115115
Assert.IsAssignableFrom(targetType, actual);
116+
var parser = (Delegate)actual;
117+
Assert.Equal(100, parser.DynamicInvoke("100"));
116118
}
117119

118120
[Theory]

test/Serilog.Settings.Configuration.Tests/Support/StaticAccessorClasses.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class ClassWithStaticAccessors
5656
public static Func<string, int> FuncIntParseProperty => int.Parse;
5757
public static NamedIntParse NamedIntParseProperty => int.Parse;
5858
public static int IntParseMethod(string value) => int.Parse(value);
59-
public static int IntParseMethod(string value, string otherValue) => int.Parse(value); // will not be chosen, extra parameter
59+
public static int IntParseMethod(string value, string otherValue) => throw new NotImplementedException(); // will not be chosen, extra parameter
6060
public static int IntParseMethod(object value) => throw new NotImplementedException(); // will not be chosen, wrong parameter type
6161
}
6262
}

0 commit comments

Comments
 (0)