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

@@ -1,6 +1,6 @@
using NFluent;
using System;
using System;
using Moq;
using NFluent;
using WireMock.Admin.Mappings;
using WireMock.Matchers;
using WireMock.Serialization;
@@ -68,7 +68,7 @@ namespace WireMock.Net.Tests.Serialization
}
[Fact]
public void MatcherModelMapper_Map_ExactObjectMatcher_Pattern()
public void MatcherModelMapper_Map_ExactObjectMatcher_ValidBase64StringPattern()
{
// Assign
var model = new MatcherModel
@@ -84,6 +84,20 @@ namespace WireMock.Net.Tests.Serialization
Check.That(matcher.ValueAsBytes).ContainsExactly(new byte[] { 115, 116, 101, 102 });
}
[Fact]
public void MatcherModelMapper_Map_ExactObjectMatcher_InvalidBase64StringPattern()
{
// Assign
var model = new MatcherModel
{
Name = "ExactObjectMatcher",
Patterns = new object[] { "_" }
};
// Act & Assert
Check.ThatCode(() => _sut.Map(model)).Throws<ArgumentException>();
}
[Fact]
public void MatcherModelMapper_Map_RegexMatcher()
{