mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
--
This commit is contained in:
@@ -556,39 +556,6 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
);
|
);
|
||||||
#endif
|
#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
|
// 400 ms
|
||||||
server
|
server
|
||||||
.Given(Request.Create()
|
.Given(Request.Create()
|
||||||
|
|||||||
Reference in New Issue
Block a user