-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
PaymentMethodTest.cs
54 lines (44 loc) · 1.39 KB
/
PaymentMethodTest.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Coinbase.Models;
using FluentAssertions;
using NUnit.Framework;
using static Coinbase.Tests.Examples;
namespace Coinbase.Tests.Endpoints
{
public class PaymentMethodTests : OAuthServerTest
{
[Test]
public async Task can_list()
{
SetupServerPagedResponse(PaginationJson, $"{PayMethod1},{PayMethod2}");
var r = await client.PaymentMethods.ListPaymentMethodsAsync();
var truth = new PagedResponse<PaymentMethod>
{
Pagination = PaginationModel,
Data = new[]
{
PayMethod1Model,
PayMethod2Model
}
};
truth.Should().BeEquivalentTo(r);
server.ShouldHaveExactCall("https://api.coinbase.com/v2/payment-methods")
.WithVerb(HttpMethod.Get);
}
[Test]
public async Task can_get()
{
SetupServerSingleResponse(PayMethod2);
var r = await client.PaymentMethods.GetPaymentMethodAsync("fff");
var truth = new Response<PaymentMethod>
{
Data = PayMethod2Model
};
truth.Should().BeEquivalentTo(r);
server.ShouldHaveExactCall($"https://api.coinbase.com/v2/payment-methods/fff")
.WithVerb(HttpMethod.Get);
}
}
}