mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 20:30:41 +00:00
add unit test for reaction client
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user