Ejemplo n.º 1
0
        public async Task TestHttpsApiRestShApiUD()
        {
            // Parameters for the API call
            string user = null;

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

            try
            {
                result = await controller.DeleteUserAsync(user);
            }
            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("{\r\n  \"request\": \"REQUEST TYPE\",\r\n  \"deleted\": \"RETURNS TRUE, IF USERS ACCOUNT WAS SUCCESSFULLY DELETED\",\r\n  \"id\": \"TRANSACTION ID\"\r\n}",
                            TestHelper.ConvertStreamToString(httpCallBackHandler.Response.RawBody),
                            "Response body should match exactly (string literal match)");
        }