Files
octokit.net/Octokit.Tests/Clients/FeedsClientTests.cs
aedampir@gmail.com d0c8e82453 Red Tests were fixed
Unused 'using' directive were removed.
2016-04-18 12:46:13 +07:00

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