public IMockProviderService MockService(
            int port,
            JsonSerializerSettings jsonSerializerSettings,
            bool enableSsl = false,
            IPAddress host = IPAddress.Loopback,
            string sslCert = null,
            string sslKey  = null)
        {
            if (String.IsNullOrEmpty(ConsumerName))
            {
                throw new InvalidOperationException(
                          "ConsumerName has not been set, please supply a consumer name using the ServiceConsumer method.");
            }

            if (String.IsNullOrEmpty(ProviderName))
            {
                throw new InvalidOperationException(
                          "ProviderName has not been set, please supply a provider name using the HasPactWith method.");
            }

            if (_mockProviderService != null)
            {
                _mockProviderService.Stop();
            }

            _mockProviderService = _mockProviderServiceFactory(port, enableSsl, ConsumerName, ProviderName, host,
                                                               jsonSerializerSettings, sslCert, sslKey);

            _mockProviderService.Start();

            return(_mockProviderService);
        }
Beispiel #2
0
        public IMockProviderService MockService(int port, bool enableSsl = false)
        {
            if (_mockProviderService != null)
            {
                _mockProviderService.Stop();
            }

            _mockProviderService = _mockProviderServiceFactory(port, enableSsl);

            _mockProviderService.Start();

            return(_mockProviderService);
        }
Beispiel #3
0
        public IMockProviderService MockService(int port)
        {
            if (_mockProviderService != null)
            {
                _mockProviderService.Stop();
            }

            _mockProviderService = _mockProviderServiceFactory(port);

            _mockProviderService.Start();

            return(_mockProviderService);
        }
Beispiel #4
0
        public IMockProviderService MockService(int port, JsonSerializerSettings jsonSerializerSettings, bool enableSsl = false, bool bindOnAllAdapters = false)
        {
            if (_mockProviderService != null)
            {
                _mockProviderService.Stop();
            }

            if (jsonSerializerSettings != null)
            {
                JsonConfig.ApiSerializerSettings = jsonSerializerSettings;
            }

            _mockProviderService = _mockProviderServiceFactory(port, enableSsl, ProviderName, bindOnAllAdapters);

            _mockProviderService.Start();

            return(_mockProviderService);
        }
 public void Stop()
 {
     _decoratedMockProvider.Stop();
 }
Beispiel #6
0
 public void TearDown()
 {
     _fakeOmdbService.Stop();
 }