diff --git a/WireMock-as-a-standalone-process.md b/WireMock-as-a-standalone-process.md index d6abe45..0788203 100644 --- a/WireMock-as-a-standalone-process.md +++ b/WireMock-as-a-standalone-process.md @@ -1,6 +1,37 @@ -##WireMock as a standalone process +## WireMock as a standalone process This is quite straight forward to launch a mock server within a console application. +### Option 1 : using the WireMock.Net.StandAlone library (https://www.nuget.org/packages/WireMock.Net.StandAlone/) +```c# +class Program +{ + static void Main(string[] args) + { + StandAloneApp.Start(args); + + Console.WriteLine("Press any key to stop the server"); + Console.ReadKey(); + } +} +``` + +### Option 2 : using the WireMock.Net.StandAlone library using the settings object +```c# +class Program +{ + static void Main(string[] args) + { + var settings = new FluentMockServerSettings { }; // see source code for all the possible properties + bool allowPartialMapping = true; + StandAloneApp.Start(settings, allowPartialMapping); + + Console.WriteLine("Press any key to stop the server"); + Console.ReadKey(); + } +} +``` + +### Option 3 : coding yourself ```c# static void Main(string[] args) {