mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-02 10:55:53 +00:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using NSubstitute;
|
|
using Octokit.Tests.Helpers;
|
|
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 TheConstructor
|
|
{
|
|
[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"), null);
|
|
}
|
|
}
|
|
}
|
|
} |