-
Notifications
You must be signed in to change notification settings - Fork 115
/
PaymentsAppServiceTest.cs
36 lines (32 loc) · 1.45 KB
/
PaymentsAppServiceTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Net.Http;
using Adyen.Model;
using Adyen.Service;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NSubstitute;
namespace Adyen.Test
{
[TestClass]
public class PaymentsAppServiceTest : BaseTest
{
[TestMethod]
public void PaymentsAppServiceTESTUrlTest()
{
var client = CreateMockForAdyenClientTest(new Config());
client.SetEnvironment(Environment.Test, "companyUrl");
var checkout = new PaymentsAppService(client);
checkout.RevokePaymentsAppAsync("{merchantId}", "{installationId}").GetAwaiter();
ClientInterfaceSubstitute.Received().RequestAsync("https://management-test.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke",
Arg.Any<string>(), null, new HttpMethod("POST"), default);
}
[TestMethod]
public void PaymentsAppServiceLIVEUrlTest()
{
var client = CreateMockForAdyenClientTest(new Config());
client.SetEnvironment(Environment.Live, "companyUrl");
var checkout = new PaymentsAppService(client);
checkout.RevokePaymentsAppAsync("{merchantId}", "{installationId}").GetAwaiter();
ClientInterfaceSubstitute.Received().RequestAsync("https://management-live.adyen.com/v1/merchants/{merchantId}/paymentsApps/{installationId}/revoke",
Arg.Any<string>(), null, new HttpMethod("POST"), default);
}
}
}