コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #3
0
        //[Ignore("PACT FLOW")]
        public void PublishToPactFlow()
        {
            // fake Git HashCode (only for demo)
            var version = "725c611";
            // master (only for demo)
            var tags          = new[] { "master" };
            var token         = Environment.GetEnvironmentVariable("PACT_BROKER_TOKEN");
            var pactPublisher = new PactPublisher("https://expandtesting.pact.dius.com.au", new PactUriOptions(token));

            pactPublisher.PublishToBroker($"../../../../../pacts/{ConsumerName.ToLower()}-{ProviderName.ToLower()}.json", version, tags);
        }
コード例 #4
0
ファイル: ProductTests.cs プロジェクト: m4cx/dwx2019-pact
        public async Task PublishToPactBroker()
        {
            var pactPublisher = new PactPublisher("http://localhost:8090");

            pactPublisher.PublishToBroker($"../../pacts/{ConsumerName.ToLower()}-{ProviderName.ToLower()}.json", "1.0.0");
        }