Ejemplo n.º 1
0
        private void PersistPactFile()
        {
            var responsePact = _mockProviderService.SendAdminHttpRequest(HttpVerb.Post, Constants.PactPath);

            if (_mockProviderService.UseRemoteMockService)
            {
                File.WriteAllText($"{_pactDir}\\{ConsumerName.ToLower()}{ProviderName.ToLower()}.json", responsePact);
            }
        }
Ejemplo n.º 2
0
        private void PersistPactFile()
        {
            var responsePact = _mockProviderService.SendAdminHttpRequest(HttpVerb.Post, Constants.PactPath);

            if (_mockProviderService.UseRemoteMockService)
            {
                string fileName = ConsumerName.ToLower() + ProviderName.ToLower() + ".json";
                File.WriteAllText(Path.Combine(_pactDir, fileName), responsePact);
            }
        }
Ejemplo n.º 3
0
        private void PersistPactFile()
        {
            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.");
            }

            var pactDetails = new PactDetails
            {
                Provider = new Pacticipant {
                    Name = ProviderName
                },
                Consumer = new Pacticipant {
                    Name = ConsumerName
                }
            };

            _mockProviderService.SendAdminHttpRequest(HttpVerb.Post, Constants.PactPath, pactDetails);
        }
Ejemplo n.º 4
0
 private void PersistPactFile()
 {
     _mockProviderService.SendAdminHttpRequest(HttpVerb.Post, Constants.PactPath);
 }
 public void SendAdminHttpRequest(HttpVerb method, string path)
 {
     _decoratedMockProvider.SendAdminHttpRequest(method, path);
 }