Proxy : also save multipart as string in mapping file (#264)

* ExactObjectMatcher

* BytesEncodingUtils

* BodyParser

* Encoding.ASCII
This commit is contained in:
Stef Heyenrath
2019-04-05 14:51:29 +02:00
committed by GitHub
parent 409d55350f
commit 3d845d5be5
11 changed files with 379 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
using System;
using NFluent;
using NFluent;
using System;
using WireMock.Admin.Mappings;
using WireMock.Matchers;
using WireMock.Serialization;
@@ -53,6 +53,23 @@ namespace WireMock.Net.Tests.Serialization
Check.That(matcher.GetPatterns()).ContainsExactly("x", "y");
}
[Fact]
public void MatcherModelMapper_Map_ExactObjectMatcher_Pattern()
{
// Assign
var model = new MatcherModel
{
Name = "ExactObjectMatcher",
Patterns = new object[] { "c3RlZg==" }
};
// Act
var matcher = (ExactObjectMatcher)MatcherMapper.Map(model);
// Assert
Check.That(matcher.ValueAsBytes).ContainsExactly(new byte[] { 115, 116, 101, 102 });
}
[Fact]
public void MatcherModelMapper_Map_RegexMatcher()
{