示例#1
0
        private void WriteResponse(HttpResponse actualResponse, TransactionExample example)
        {
            actualResponse.Clear();

            var exampleResponse = example.GetResponsesCs().First();

            // write status code
            if (!string.IsNullOrWhiteSpace(exampleResponse.name))
            {
                int statusCode;
                if (int.TryParse(exampleResponse.name, out statusCode))
                {
                    actualResponse.StatusCode = statusCode;
                }
            }

            // write headers
            exampleResponse
            .GetHeadersCs()
            .ForEach(h => actualResponse.AppendHeader(h.Item1, h.Item2));

            //write body
            actualResponse.Write(exampleResponse.body);
        }
示例#2
0
 public void returns_non_empty_example_responses_collection()
 {
     Assert.IsTrue(_example.GetResponsesCs().Any());
 }