コード例 #1
0
        private Response HandlePostInteractionsRequest(NancyContext context)
        {
            var interactionJson = ReadContent(context.Request.Body);
            var interaction     = JsonConvert.DeserializeObject <ProviderServiceInteraction>(interactionJson);

            _mockProviderRepository.AddInteraction(interaction);

            return(GenerateResponse(HttpStatusCode.OK, "Added interaction"));
        }
コード例 #2
0
        private Response HandlePostInteractionsRequest(NancyContext context)
        {
            var interactionJson = ReadContent(context.Request.Body);
            var interaction     = JsonConvert.DeserializeObject <ProviderServiceInteraction>(interactionJson);

            _mockProviderRepository.AddInteraction(interaction);

            _log.InfoFormat("Registered expected interaction {0} {1}", interaction.Request.Method.ToString().ToUpperInvariant(), interaction.Request.Path);
            _log.Debug(JsonConvert.SerializeObject(interaction, JsonConfig.PactFileSerializerSettings));

            return(GenerateResponse(HttpStatusCode.OK, "Added interaction"));
        }