mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
36 lines
1014 B
C#
36 lines
1014 B
C#
using System;
|
|
using NSubstitute;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Clients
|
|
{
|
|
/// <summary>
|
|
/// Client tests mostly just need to make sure they call the IApiConnection with the correct
|
|
/// relative Uri. No need to fake up the response. All *those* tests are in ApiConnectionTests.cs.
|
|
/// </summary>
|
|
public class FeedsClientTests
|
|
{
|
|
public class TheCtor
|
|
{
|
|
[Fact]
|
|
public void EnsuresNonNullArguments()
|
|
{
|
|
Assert.Throws<ArgumentNullException>(() => new FeedsClient(null));
|
|
}
|
|
}
|
|
|
|
public class TheGetFeedsMethod
|
|
{
|
|
[Fact]
|
|
public void RequestsCorrectUrl()
|
|
{
|
|
var connection = Substitute.For<IApiConnection>();
|
|
var feedsClient = new FeedsClient(connection);
|
|
|
|
feedsClient.GetFeeds();
|
|
|
|
connection.Received().Get<Feed>(Arg.Is<Uri>(u => u.ToString() == "feeds"));
|
|
}
|
|
}
|
|
}
|
|
} |