Add some more tests

This commit is contained in:
Stef Heyenrath
2018-03-14 21:24:20 +01:00
parent c2183ab40c
commit 15500a812c
10 changed files with 202 additions and 9 deletions

View File

@@ -20,15 +20,16 @@ namespace WireMock.Serialization
return null;
}
IStringMatcher stringMatcher = matcher as IStringMatcher;
string[] patterns = stringMatcher != null ? stringMatcher.GetPatterns() : new string[0];
string[] patterns = matcher is IStringMatcher stringMatcher ? stringMatcher.GetPatterns() : new string[0];
bool? ignorecase = matcher is IIgnoreCaseMatcher ignoreCaseMatcher ? ignoreCaseMatcher.IgnoreCase : (bool?)null;
return new MatcherModel
{
IgnoreCase = ignorecase,
Name = matcher.GetName(),
Pattern = patterns.Length == 1 ? patterns.First() : null,
Patterns = patterns.Length > 1 ? patterns : null
};
}
}
}
}