FluentMockServerSettings (#21)

This commit is contained in:
Stef Heyenrath
2017-03-20 17:22:09 +01:00
parent 7793330d1d
commit bd8e18b2c4
8 changed files with 305 additions and 44 deletions

View File

@@ -16,6 +16,12 @@ namespace WireMock.Net.StandAlone
[SwitchArgument('p', "AllowPartialMapping", true, Description = "Allow Partial Mapping (default set to true).", Optional = true)]
public bool AllowPartialMapping { get; set; }
[SwitchArgument('s', "StartAdminInterface", true, Description = "Start the AdminInterface (default set to true).", Optional = true)]
public bool StartAdminInterface { get; set; }
[SwitchArgument('r', "ReadStaticMappings", true, Description = "Read StaticMappings from ./__admin/mappings (default set to true).", Optional = true)]
public bool ReadStaticMappings { get; set; }
}
static void Main(params string[] args)
@@ -31,7 +37,12 @@ namespace WireMock.Net.StandAlone
if (!options.Urls.Any())
options.Urls.Add("http://localhost:9090/");
var server = FluentMockServer.StartWithAdminInterface(options.Urls.ToArray());
var server = FluentMockServer.Start(new FluentMockServerSettings
{
Urls = options.Urls.ToArray(),
StartAdminInterface = options.StartAdminInterface,
ReadStaticMappings = options.ReadStaticMappings
});
if (options.AllowPartialMapping)
server.AllowPartialMapping();