add unit test for reaction client

This commit is contained in:
maddin2016
2016-06-01 11:58:02 +02:00
parent c4c374c532
commit 2ebe0eed89
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,33 @@
using NSubstitute;
using System;
using System.Threading.Tasks;
using Xunit;
namespace Octokit.Tests.Clients
{
public class ReactionsClientTests
{
public class TheCtor
{
[Fact]
public void EnsuresNonNullArguments()
{
Assert.Throws<ArgumentNullException>(() => new ReactionsClient(null));
}
}
public class TheDeleteMethod
{
[Fact]
public async Task DeletesCorrectUrl()
{
var connection = Substitute.For<IApiConnection>();
var client = new ReactionsClient(connection);
await client.Delete(42);
connection.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "reactions/42"));
}
}
}
}
+1
View File
@@ -97,6 +97,7 @@
<Compile Include="Clients\MergingClientTests.cs" />
<Compile Include="Clients\OauthClientTests.cs" />
<Compile Include="Clients\PullRequestReviewCommentReactionsClientTests.cs" />
<Compile Include="Clients\ReactionsClientTests.cs" />
<Compile Include="Clients\RepositoryCommentsClientTests.cs" />
<Compile Include="Clients\DeploymentsClientTests.cs" />
<Compile Include="Clients\DeploymentStatusClientTests.cs" />