mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-27 00:23:39 +00:00
1d64210ac5
Since Enterprise base URLs end with /api/v3 we need to make sure the endpoints are relative and not absolute.
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System;
|
|
using NSubstitute;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Clients
|
|
{
|
|
public class NotificationsClientTests
|
|
{
|
|
public class TheGetAllForCurrentMethod
|
|
{
|
|
[Fact]
|
|
public void RequestsCorrectUrl()
|
|
{
|
|
var endpoint = new Uri("notifications", UriKind.Relative);
|
|
var connection = Substitute.For<IApiConnection>();
|
|
var client = new NotificationsClient(connection);
|
|
|
|
client.GetAllForCurrent();
|
|
|
|
connection.Received().GetAll<Notification>(endpoint);
|
|
}
|
|
}
|
|
|
|
public class TheGetAllForRepository
|
|
{
|
|
[Fact]
|
|
public void RequestsCorrectUrl()
|
|
{
|
|
var endpoint = new Uri("repos/banana/split/notifications", UriKind.Relative);
|
|
var connection = Substitute.For<IApiConnection>();
|
|
var client = new NotificationsClient(connection);
|
|
|
|
client.GetAllForRepository("banana", "split");
|
|
|
|
connection.Received().GetAll<Notification>(endpoint);
|
|
}
|
|
}
|
|
}
|
|
}
|