Esempio n. 1
0
        /// <summary>
        /// Test
        /// </summary>
        /// <param name="httpRequestService">the httpRequestService</param>
        public void Test(IHttpRequestService httpRequestService)
        {
            foreach (var testCase in this)
            {
                if (testCase.Arranges.Expected != null && testCase.Arranges.Expected.HttpRequest != null)
                {
                    testCase.Arranges.Expected.HttpResponse = httpRequestService.GetResponse(testCase.Arranges.Expected.HttpRequest);
                }

                if (testCase.Arranges.Actual != null)
                {
                    testCase.Arranges.Actual.HttpResponse = httpRequestService.GetResponse(testCase.Arranges.Actual.HttpRequest);
                }

                testCase.Assert(testCase.Arranges.Expected, testCase.Arranges.Actual);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Test
        /// </summary>
        /// <param name="httpRequestService">the httpRequestService</param>
        /// <param name="hookForActual">the hookForActual</param>
        /// <param name="hookForExpected">the hookForExpected</param>
        public void Test(IHttpRequestService httpRequestService,
                         Action <HttpClient> hookForActual   = null,
                         Action <HttpClient> hookForExpected = null)
        {
            foreach (var testCase in this)
            {
                if (testCase.Arranges.Expected != null && testCase.Arranges.Expected.HttpRequest != null)
                {
                    testCase.Arranges.Expected.HttpResponse = httpRequestService.GetResponse(testCase.Arranges.Expected.HttpRequest, hookForExpected);
                }

                if (testCase.Arranges.Actual != null)
                {
                    testCase.Arranges.Actual.HttpResponse = httpRequestService.GetResponse(testCase.Arranges.Actual.HttpRequest, hookForActual);
                }

                testCase.Assert(testCase.Arranges.Expected, testCase.Arranges.Actual);
            }
        }