示例#1
0
        public async Task TestHttpsApiRestShApiVA()
        {
            // Parameters for the API call
            Models.UserAddressVerificationInput input = new Models.UserAddressVerificationInput();
            input.User    = null;
            input.A       = null;
            input.Sa      = null;
            input.C       = null;
            input.S       = null;
            input.Z       = 0;
            input.Address = null;

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

            try
            {
                result = await controller.UserAddressVerificationAsync(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("{\r\n  \"request\": \"REQUEST TYPE\",\r\n  \"active\": \"RETURNS TRUE, IF ADDRESS IS ACTIVE AND IF USER IS CURRENTLY THERE\",\r\n  \"id\": \"TRANSACTION ID\"\r\n}",
                            TestHelper.ConvertStreamToString(httpCallBackHandler.Response.RawBody),
                            "Response body should match exactly (string literal match)");
        }