-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathAccountsTest.cs
74 lines (53 loc) · 1.73 KB
/
AccountsTest.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
using NUnit.Framework;
using VerifyNUnit;
namespace Coinbase.Tests.EndpointTests
{
public class AccountsTest : TestWithAuth
{
[Test]
public async Task get_all_accounts()
{
server.RespondWithJsonTestFile();
var r = await client.Accounts.GetAllAccountsAsync();
r.Dump();
var a = r.First();
a.Currency.Should().Be("BTC");
a.Id.Should().Be("71452118-efc7-4cc4-8780-a5e22d4baa53");
server.ShouldHaveCalledSomePathAndQuery("/accounts");
await Verifier.Verify(r);
}
[Test]
public async Task can_get_account()
{
server.RespondWithJsonTestFile();
var r = await client.Accounts.GetAccountAsync("fff");
r.Dump();
r.Currency.Should().Be("BTC");
r.Id.Should().Be("71452118-efc7-4cc4-8780-a5e22d4baa53");
server.ShouldHaveCalledSomePathAndQuery("/accounts/fff");
await Verifier.Verify(r);
}
[Test]
public async Task get_history()
{
server.RespondWithJsonTestFile();
var r = await client.Accounts.GetAccountHistoryAsync("fff");
server.ShouldHaveCalledSomePathAndQuery("/accounts/fff/ledger");
await Verifier.Verify(r);
}
[Test]
public async Task get_hold()
{
server.RespondWithJsonTestFile();
var r = await client.Accounts.GetAccountHoldAsync("fff");
r.Dump();
var h = r.Data.First();
h.AccountId.Should().Be("e0b3f39a-183d-453e-b754-0c13e5bab0b3");
server.ShouldHaveCalledSomePathAndQuery("/accounts/fff/holds");
await Verifier.Verify(r);
}
}
}