예제 #1
0
 public async Task ApproveTransactionAsync()
 {
     using (TestServer server = TestServer.Create <Startup>())
     {
         var client = new ManagementClient(server.HttpClient);
         await client.ApproveTransactionAsync(1, "password");
     };
 }
예제 #2
0
        public async Task ApproveTransaction_OK_Success()
        {
            int    transactionId = 534536434;
            string password      = "******";

            var mockHttp = new MockHttpMessageHandler();

            mockHttp.When(Urls.GetApproveTransactionUrl(transactionId, password))
            .Respond(HttpStatusCode.OK);

            var httpClient = new HttpClient(mockHttp)
            {
                BaseAddress = new Uri("https://gw.freepay.dk")
            };
            IManagementClient client = new ManagementClient(httpClient);
            await client.ApproveTransactionAsync(transactionId, password);

            mockHttp.Expect(HttpMethod.Get, "https://gw.freepay.dk" + Urls.GetApproveTransactionUrl(transactionId, password));
        }