Files
octokit.net/Octokit.Tests/Clients/NotificationsClientTests.cs
T
Haacked 1d64210ac5 Fix endpoint URLs for Enterprise support
Since Enterprise base URLs end with /api/v3 we need to make sure
the endpoints are relative and not absolute.
2013-10-29 16:02:00 -07:00

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);
}
}
}
}