mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
--
This commit is contained in:
@@ -556,39 +556,6 @@ namespace WireMock.Net.ConsoleApplication
|
||||
);
|
||||
#endif
|
||||
|
||||
#if MIMEKIT
|
||||
var textPlainContentTypeMatcher = new ContentTypeMatcher("text/plain");
|
||||
var textPlainContentMatcher = new ExactMatcher("This is some plain text");
|
||||
var textPlainMatcher = new MimePartMatcher(MatchBehaviour.AcceptOnMatch, textPlainContentTypeMatcher, null, null, textPlainContentMatcher);
|
||||
|
||||
var textJsonContentTypeMatcher = new ContentTypeMatcher("text/json");
|
||||
var textJsonContentMatcher = new JsonMatcher(new { Key = "Value" }, true);
|
||||
var textJsonMatcher = new MimePartMatcher(MatchBehaviour.AcceptOnMatch, textJsonContentTypeMatcher, null, null, textJsonContentMatcher);
|
||||
|
||||
var imagePngContentTypeMatcher = new ContentTypeMatcher("image/png");
|
||||
var imagePngContentDispositionMatcher = new ExactMatcher("attachment; filename=\"image.png\"");
|
||||
var imagePngContentTransferEncodingMatcher = new ExactMatcher("base64");
|
||||
var imagePngContentMatcher = new ExactObjectMatcher(Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAgMAAAAP2OW3AAAADFBMVEX/tID/vpH/pWX/sHidUyjlAAAADElEQVR4XmMQYNgAAADkAMHebX3mAAAAAElFTkSuQmCC"));
|
||||
var imagePngMatcher = new MimePartMatcher(MatchBehaviour.AcceptOnMatch, imagePngContentTypeMatcher, imagePngContentDispositionMatcher, imagePngContentTransferEncodingMatcher, imagePngContentMatcher);
|
||||
|
||||
var matchers = new IMatcher[]
|
||||
{
|
||||
textPlainMatcher,
|
||||
textJsonMatcher,
|
||||
imagePngMatcher
|
||||
};
|
||||
|
||||
server
|
||||
.Given(Request.Create()
|
||||
.WithPath("/multipart")
|
||||
.UsingPost()
|
||||
.WithMultiPart(matchers)
|
||||
)
|
||||
.WithGuid("b9c82182-e469-41da-bcaf-b6e3157fefdb")
|
||||
.RespondWith(Response.Create()
|
||||
.WithBody("MultiPart is ok")
|
||||
);
|
||||
#endif
|
||||
// 400 ms
|
||||
server
|
||||
.Given(Request.Create()
|
||||
|
||||
Reference in New Issue
Block a user