Match Method
Definition
- Namespace
- Codebelt.Extensions.Xunit
- Assemblies
- Codebelt.Extensions.Xunit.dll
Match(string, string, Action<WildcardOptions>)
Provides a way, with wildcard support, to determine if actual matches expected.
public static bool Match(string expected, string actual, Action<WildcardOptions> setup = null)
Parameters
expectedstringThe expected string value.
actualstringThe actual string value.
setupAction<WildcardOptions>The WildcardOptions which may be configured.
Returns
- bool
trueifactualmatchesexpected,falseotherwise.
Remarks
Credits for inspiration goes to this SO answer: https://stackoverflow.com/questions/30299671/matching-strings-with-wildcard/30300521#30300521
Exceptions
- ArgumentOutOfRangeException
expectedcannot be matched withactual. Includes the non-matched string(s) in ActualValue.- ArgumentNullException
expectedisnull-or-actualisnull.