mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-12-06 15:06:45 +01:00
20 lines
736 B
C#
20 lines
736 B
C#
// #:package WireMock.Net@2.35.0
|
|
#:project ../src/WireMock.Net/WireMock.Net.csproj
|
|
|
|
using System;
|
|
using System.Linq;
|
|
using WireMock.RequestBuilders;
|
|
using WireMock.ResponseBuilders;
|
|
using WireMock.Server;
|
|
|
|
static bool MimePluginLoaded() => AppDomain.CurrentDomain.GetAssemblies()
|
|
.Any(a => a.GetName().Name == "WireMock.Net.MimePart");
|
|
|
|
using var server = WireMockServer.Start();
|
|
server.Given(Request.Create().WithPath("/ping").UsingGet())
|
|
.RespondWith(Response.Create().WithStatusCode(200));
|
|
|
|
using var client = server.CreateClient();
|
|
Console.WriteLine($"Before GET: {MimePluginLoaded()}");
|
|
using var response = await client.GetAsync("/ping");
|
|
Console.WriteLine($"After GET ({(int)response.StatusCode}): {MimePluginLoaded()}"); |