When posting new mapping, use DateParseHandling.None (#348)

* .

* OfType + test

* remove line
This commit is contained in:
Stef Heyenrath
2019-09-20 13:44:19 +02:00
committed by GitHub
parent 9cd16f726f
commit 666992ef24
6 changed files with 52 additions and 22 deletions

View File

@@ -40,7 +40,7 @@ namespace WireMock.RequestBuilders
/// <returns>A List{T}</returns>
public IList<T> GetRequestMessageMatchers<T>() where T : IRequestMatcher
{
return new ReadOnlyCollection<T>(_requestMatchers.Where(rm => rm is T).Cast<T>().ToList());
return new ReadOnlyCollection<T>(_requestMatchers.OfType<T>().ToList());
}
/// <summary>
@@ -50,7 +50,7 @@ namespace WireMock.RequestBuilders
/// <returns>A RequestMatcher</returns>
public T GetRequestMessageMatcher<T>() where T : IRequestMatcher
{
return _requestMatchers.Where(rm => rm is T).Cast<T>().FirstOrDefault();
return _requestMatchers.OfType<T>().FirstOrDefault();
}
/// <inheritdoc cref="IClientIPRequestBuilder.WithClientIP(IStringMatcher[])"/>