Beispiel #1
0
        private void ExecuteFlowApiTestCase(FlowApiTestCase testItem, string quoteId = null)
        {
            ParameterValidator.ValidateNotNull(testItem, "Test Item");

            AssignTestName(testItem);

            var breezeApi = new BreezeApi(EnvironmentSetting, quoteId);

            foreach (var stepItem in testItem.TestCaseSteps)
            {
                // Given
                var    parameters = stepItem.Parameters.ToJObject();
                string screenName = parameters.Item("screenName");
                var    header     = parameters.Item("header");
                // Generate dynamic data for budy
                var body = breezeApi.ConvertDynamicData(stepItem.Body);

                // When
                IRestResponse result = breezeApi.ExecuteBreezeAPI(screenName, body, header);

                // Then
                result.StatusCode.Should().Be(stepItem.ExpectedStatusCode);
                // Update dynamic Id from response content
                breezeApi.UpdateDynamicIdData(screenName, result.Content);
                // Generate dynamic data for expected result
                var expectedResult = breezeApi.ConvertDynamicData(stepItem.ExpectedResult);

                var expectedResponse = breezeApi.GetExpectedResponseObject(expectedResult);
                var actualResponse   = breezeApi.GetActualResponseObject(result.Content);

                actualResponse.ShouldBeEquivalentTo(expectedResponse);
            }
        }
Beispiel #2
0
 public void API_Breeze_Vehicle_BodyType(FlowApiTestCase testItem)
 {
     ExecuteFlowApiTestCase(testItem);
 }