예제 #1
0
        static void Main(string[] args)
        {
            XmlConfigurator.Configure(LogRepository, new FileInfo("log4net.config"));

            var settings = WireMockServerSettingsParser.ParseArguments(args, new WireMockLog4NetLogger());

            settings.Logger.Debug("WireMock.Net server arguments [{0}]", string.Join(", ", args.Select(a => $"'{a}'")));

            _server = WireMockServer.Start(settings);

            Console.WriteLine($"{DateTime.UtcNow} Press Ctrl+C to shut down");

            Console.CancelKeyPress += (s, e) =>
            {
                Stop("CancelKeyPress");
            };

            System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += ctx =>
            {
                Stop("AssemblyLoadContext.Default.Unloading");
            };

            while (true)
            {
                Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server running : {_server.IsStarted}");
                Thread.Sleep(sleepTime);
            }
        }
예제 #2
0
        public static WireMockServer Start([NotNull] string[] args, [CanBeNull] IWireMockLogger logger = null)
        {
            Check.NotNull(args, nameof(args));

            var settings = WireMockServerSettingsParser.ParseArguments(args);

            settings.Logger.Debug("WireMock.Net server arguments [{0}]", string.Join(", ", args.Select(a => $"'{a}'")));

            return(Start(settings));
        }
예제 #3
0
        static void Main(string[] args)
        {
            var settings = WireMockServerSettingsParser.ParseArguments(args);

            settings.Logger.Debug("WireMock.Net server arguments [{0}]", string.Join(", ", args.Select(a => $"'{a}'")));

            WireMockServer.Start(settings);

            Console.WriteLine("Press any key to stop the server");
            Console.ReadKey();
        }
예제 #4
0
        static void Main(params string[] args)
        {
            XmlConfigurator.Configure(new FileInfo("log4net.config"));

            var settings = WireMockServerSettingsParser.ParseArguments(args);

            settings.Logger.Debug("WireMock.Net server arguments [{0}]", string.Join(", ", args.Select(a => $"'{a}'")));

            WireMockServer.Start(settings);

            Console.WriteLine("Press any key to stop the server");
            Console.ReadKey();
        }