Example #1
0
        private void Simulate()
        {
            _logger.Information(string.Format("Start running the simulation for the specified pact on port {0}", _port));

            _webServer = new WebServer(_logger);
            _webServer.Simulate(PactCallback, _port);
        }
        public ISimulation Configure(int port, string type, string payload, Func <int, HttpListenerContext, HttpResponseMessage> callbackMethod)
        {
            Port           = port;
            Type           = type;
            Payload        = payload;
            CallbackMethod = callbackMethod;

            WebServer.Simulate(CallbackMethod, Port);

            return(this);
        }
Example #3
0
        public IDisposable Echo(int statusCode)
        {
            _logger.Information(string.Format("Start running the echo simulation for the specified pact on port {0}", _port));

            _echoStatus = statusCode;

            _webServer = new WebServer(_logger);
            _webServer.Simulate(EchoCallback, _port);

            return(this);
        }