Exemple #1
0
        public async Task TestHttpsApiRestShApiSE()
        {
            // Parameters for the API call
            Models.DataAndFileEncryptionInput input = new Models.DataAndFileEncryptionInput();
            input.Data   = null;
            input.Method = null;
            input.Bit    = 0;

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

            try
            {
                result = await controller.DataAndFileEncryptionAsync(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    \"data\": \"RETURNED ENCRYPTED DATA URL\",\n    \"file\": \"RETURNED ENCRYPTED FILE URL\",\n    \"success\": \"SHOWS TRUE IF ENCRYPTION WAS SUCCESSFULL\",\n    \"public\": \"PUBLIC ENCRYPTION KEY FOR YOUR DATA OR FILES\",\n    \"private\": \"PRIVATE ENCRYPTION KEY FOR YOUR DATA OR FILES\"\n}",
                            TestHelper.ConvertStreamToString(httpCallBackHandler.Response.RawBody),
                            "Response body should match exactly (string literal match)");
        }