@@ -18,7 +18,7 @@ namespace WireMock.Matchers;
18
18
/// CSharpCode / CS-Script Matcher
19
19
/// </summary>
20
20
/// <inheritdoc cref="ICSharpCodeMatcher"/>
21
- internal class CSharpCodeMatcher : ICSharpCodeMatcher
21
+ public class CSharpCodeMatcher : ICSharpCodeMatcher
22
22
{
23
23
private const string TemplateForIsMatchWithString = "public class CodeHelper {{ public bool IsMatch(string it) {{ {0} }} }}" ;
24
24
@@ -63,17 +63,24 @@ public CSharpCodeMatcher(MatchBehaviour matchBehaviour, MatchOperator matchOpera
63
63
Value = patterns ;
64
64
}
65
65
66
- public MatchResult IsMatch ( string ? input )
67
- {
68
- return IsMatchInternal ( input ) ;
69
- }
66
+ /// <inheritdoc />
67
+ public MatchResult IsMatch ( string ? input ) => IsMatchInternal ( input ) ;
70
68
71
- public MatchResult IsMatch ( object ? input )
69
+ /// <inheritdoc />
70
+ public MatchResult IsMatch ( object ? input ) => IsMatchInternal ( input ) ;
71
+
72
+ /// <inheritdoc />
73
+ public string GetCSharpCodeArguments ( )
72
74
{
73
- return IsMatchInternal ( input ) ;
75
+ return $ "new { Name } " +
76
+ $ "(" +
77
+ $ "{ MatchBehaviour . GetFullyQualifiedEnumValue ( ) } , " +
78
+ $ "{ MatchOperator . GetFullyQualifiedEnumValue ( ) } , " +
79
+ $ "{ MappingConverterUtils . ToCSharpCodeArguments ( _patterns ) } " +
80
+ $ ")";
74
81
}
75
82
76
- public MatchResult IsMatchInternal ( object ? input )
83
+ private MatchResult IsMatchInternal ( object ? input )
77
84
{
78
85
var score = MatchScores . Mismatch ;
79
86
Exception ? exception = null ;
@@ -93,17 +100,6 @@ public MatchResult IsMatchInternal(object? input)
93
100
return new MatchResult ( MatchBehaviourHelper . Convert ( MatchBehaviour , score ) , exception ) ;
94
101
}
95
102
96
- /// <inheritdoc />
97
- public string GetCSharpCodeArguments ( )
98
- {
99
- return $ "new { Name } " +
100
- $ "(" +
101
- $ "{ MatchBehaviour . GetFullyQualifiedEnumValue ( ) } , " +
102
- $ "{ MatchOperator . GetFullyQualifiedEnumValue ( ) } , " +
103
- $ "{ MappingConverterUtils . ToCSharpCodeArguments ( _patterns ) } " +
104
- $ ")";
105
- }
106
-
107
103
private bool IsMatch ( dynamic input , string pattern )
108
104
{
109
105
var isMatchWithString = input is string ;
0 commit comments