Skip to content

Commit 6ac2018

Browse files
committed
.
1 parent d727645 commit 6ac2018

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//#if CSHARPMATCHER
21
using System;
32
using System.Linq;
43
using System.Reflection;
@@ -145,24 +144,24 @@ private bool IsMatch(dynamic input, string pattern)
145144
}
146145
}
147146
#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+
}
166165

167166
#elif (NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0_OR_GREATER)
168167
Assembly assembly;
@@ -194,7 +193,7 @@ private bool IsMatch(dynamic input, string pattern)
194193
throw new WireMockException("CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper", ex);
195194
}
196195
#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");
198197
#endif
199198
try
200199
{
@@ -232,5 +231,4 @@ public AnyOf<string, StringPattern>[] GetPatterns()
232231

233232
/// <inheritdoc />
234233
public string Name => nameof(CSharpCodeMatcher);
235-
}
236-
//#endif
234+
}

0 commit comments

Comments
 (0)