-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathFillsTest.cs
54 lines (42 loc) · 1.36 KB
/
FillsTest.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 FluentAssertions;
using NUnit.Framework;
using VerifyNUnit;
namespace Coinbase.Tests.EndpointTests
{
public class FillsTest : TestWithAuth
{
[Test]
public async Task getall_by_product()
{
server.RespondWithJsonTestFilePagedResult(11, 22);
var r = await client.Fills.GetFillsByProductIdAsync("ETC-USD");
server.ShouldHaveCalledSomePathAndQuery("/fills?product_id=ETC-USD")
.WithVerb(HttpMethod.Get);
r.Before.Should().Be("11");
r.After.Should().Be("22");
var f = r.Data.First();
f.UserId.Should().StartWith("fff");
f.TradeId.Should().Be(59);
f.Price.Should().Be(50m);
await Verifier.Verify(r);
}
[Test]
public async Task getall_by_order()
{
server.RespondWithJsonTestFilePagedResult(11, 22);
var r = await client.Fills.GetFillsByOrderIdAsync("333");
server.ShouldHaveCalledSomePathAndQuery("/fills?order_id=333")
.WithVerb(HttpMethod.Get);
r.Before.Should().Be("11");
r.After.Should().Be("22");
var f = r.Data.First();
f.UserId.Should().StartWith("fff");
f.TradeId.Should().Be(59);
f.Price.Should().Be(50m);
await Verifier.Verify(r);
}
}
}