-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
NotificationTests.cs
53 lines (43 loc) · 1.34 KB
/
NotificationTests.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
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 NotificationTests : OAuthServerTest
{
[Test]
public async Task can_list()
{
SetupServerPagedResponse(PaginationJson, $"{Notification1}");
var r = await client.Notifications.ListNotificationsAsync();
var truth = new PagedResponse<Notification>
{
Pagination = PaginationModel,
Data = new[]
{
Notification1Model
}
};
truth.Should().BeEquivalentTo(r);
server.ShouldHaveExactCall("https://api.coinbase.com/v2/notifications")
.WithVerb(HttpMethod.Get);
}
[Test]
public async Task can_get()
{
SetupServerSingleResponse(Notification2);
var r = await client.Notifications.GetNotificationAsync("fff");
var truth = new Response<Notification>
{
Data = Notification2Model
};
truth.Should().BeEquivalentTo(r);
server.ShouldHaveExactCall($"https://api.coinbase.com/v2/notifications/fff")
.WithVerb(HttpMethod.Get);
}
}
}