-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (27 loc) · 912 Bytes
/
Copy pathProgram.cs
File metadata and controls
32 lines (27 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Linq;
using WireMock.Net.OpenApiParser;
using WireMock.Server;
namespace wiremock
{
class Program
{
static void Main(string[] args)
{
var server = WireMockServer.StartWithAdminInterface(3333);
var mappingModels = new WireMockOpenApiParser().FromFile("./test.yaml", out var diagnostic).ToArray();
Console.WriteLine(diagnostic);
if (!args.Contains("nomappings"))
{
server.WithMapping(mappingModels);
Console.WriteLine($"Added {mappingModels.Length} mappings");
foreach (var mapping in mappingModels)
{
Console.WriteLine(mapping.Request.Path);
}
}
Console.WriteLine($"Server running at: {string.Join(',', server.Urls)}");
Console.ReadLine();
}
}
}