Beispiel #1
0
        public async Task TestHttpsApiRestShApiD()
        {
            // Parameters for the API call
            Models.HttpsApiRestShApiDInput input = new Models.HttpsApiRestShApiDInput();
            input.Data      = null;
            input.Transform = null;

            // Perform API call
            Models.DataManipulationModelResponse result = null;

            try
            {
                result = await controller.HttpsApiRestShApiDAsync(input);
            }
            catch (APIException) {};

            // Test response code
            Assert.AreEqual(200, httpCallBackHandler.Response.StatusCode,
                            "Status should be 200");

            // Test whether the captured response is as we expected
            Assert.IsNotNull(result, "Result should exist");

            Assert.AreEqual("{\n    \"request\": \"REQUEST TYPE\",\n    \"url\": \"RETURNED DATA URL\",\n    \"success\": \"RETURNS TRUE IF DATA MANIPULATION WAS SUCCESSFULL\",\n    \"id\": \"TRANSACTION ID\"\n}",
                            TestHelper.ConvertStreamToString(httpCallBackHandler.Response.RawBody),
                            "Response body should match exactly (string literal match)");
        }