Commit 6ac2018 1 parent d727645 commit 6ac2018 Copy full SHA for 6ac2018
File tree 1 file changed +20
-22
lines changed
src/WireMock.Net.Matchers.CSharpCode/Matchers
1 file changed +20
-22
lines changed Original file line number Diff line number Diff line change 1
- //#if CSHARPMATCHER
2
1
using System ;
3
2
using System . Linq ;
4
3
using System . Reflection ;
@@ -145,24 +144,24 @@ private bool IsMatch(dynamic input, string pattern)
145
144
}
146
145
}
147
146
#elif ( NET46 || NET461 )
148
- dynamic script ;
149
- try
150
- {
151
- script = CSScriptLibrary . CSScript . Evaluator . CompileCode ( source ) . CreateObject ( "*" ) ;
152
- }
153
- catch ( Exception ex )
154
- {
155
- throw new WireMockException ( "CSharpCodeMatcher: Unable to create compiler for WireMock.CodeHelper" , ex ) ;
156
- }
157
-
158
- try
159
- {
160
- result = script . IsMatch ( inputValue ) ;
161
- }
162
- catch ( Exception ex )
163
- {
164
- throw new WireMockException ( "CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper" , ex ) ;
165
- }
147
+ dynamic script ;
148
+ try
149
+ {
150
+ script = CSScriptLibrary . CSScript . Evaluator . CompileCode ( source ) . CreateObject ( "*" ) ;
151
+ }
152
+ catch ( Exception ex )
153
+ {
154
+ throw new WireMockException ( "CSharpCodeMatcher: Unable to create compiler for WireMock.CodeHelper" , ex ) ;
155
+ }
156
+
157
+ try
158
+ {
159
+ result = script . IsMatch ( inputValue ) ;
160
+ }
161
+ catch ( Exception ex )
162
+ {
163
+ throw new WireMockException ( "CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper" , ex ) ;
164
+ }
166
165
167
166
#elif ( NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0_OR_GREATER )
168
167
Assembly assembly ;
@@ -194,7 +193,7 @@ private bool IsMatch(dynamic input, string pattern)
194
193
throw new WireMockException ( "CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper" , ex ) ;
195
194
}
196
195
#else
197
- throw new NotSupportedException ( "The 'CSharpCodeMatcher' cannot be used in netstandard 1.3" ) ;
196
+ throw new NotSupportedException ( "The 'CSharpCodeMatcher' cannot be used in netstandard 1.3" ) ;
198
197
#endif
199
198
try
200
199
{
@@ -232,5 +231,4 @@ public AnyOf<string, StringPattern>[] GetPatterns()
232
231
233
232
/// <inheritdoc />
234
233
public string Name => nameof ( CSharpCodeMatcher ) ;
235
- }
236
- //#endif
234
+ }
You can’t perform that action at this time.
0 commit comments