mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-12-05 06:16:35 +01:00
Create WireMock.Net.MimePart project (#1300)
* Create WireMock.Net.MimePart project * . * REFACTOR * ILRepack * -- * ... * x * x * . * fix * public class MimePartMatcher * shared * min * . * <!--<DelaySign>true</DelaySign>--> * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
c15206ecd8
commit
96eca4262a
306 files changed
+9746
-9285
No files matched your search
@@ -0,0 +1,42 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Stef.Validation;
|
||||
using WireMock.Matchers.Request;
|
||||
using WireMock.RequestBuilders;
|
||||
|
||||
namespace WireMock.Server;
|
||||
|
||||
public partial class WireMockServer
|
||||
{
|
||||
/// <summary>
|
||||
/// Given
|
||||
/// </summary>
|
||||
/// <param name="requestMatcher">The request matcher.</param>
|
||||
/// <param name="saveToFile">Optional boolean to indicate if this mapping should be saved as static mapping file.</param>
|
||||
/// <returns>The <see cref="IRespondWithAProvider"/>.</returns>
|
||||
[PublicAPI]
|
||||
public IRespondWithAProvider Given(IRequestMatcher requestMatcher, bool saveToFile = false)
|
||||
{
|
||||
return _mappingBuilder.Given(requestMatcher, saveToFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WhenRequest
|
||||
/// </summary>
|
||||
/// <param name="action">The action to use the fluent <see cref="IRequestBuilder"/>.</param>
|
||||
/// <param name="saveToFile">Optional boolean to indicate if this mapping should be saved as static mapping file.</param>
|
||||
/// <returns>The <see cref="IRespondWithAProvider"/>.</returns>
|
||||
[PublicAPI]
|
||||
public IRespondWithAProvider WhenRequest(Action<IRequestBuilder> action, bool saveToFile = false)
|
||||
{
|
||||
Guard.NotNull(action);
|
||||
|
||||
var requestBuilder = Request.Create();
|
||||
|
||||
action(requestBuilder);
|
||||
|
||||
return Given(requestBuilder, saveToFile);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user