Skip to content

Commit

Permalink
failing test: TeamClient.AddMembership(..) using a real ApiConnection…
Browse files Browse the repository at this point in the history
… throws an ArgumentNullExceptionValue
  • Loading branch information
davidalpert committed Jul 31, 2015
1 parent a7bc09e commit dfbd084
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Octokit.Tests/Clients/TeamsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Octokit.Tests.Clients
{
/// <summary>
/// Client tests mostly just need to make sure they call the IApiConnection with the correct
/// 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 TeamsClientTests
Expand Down Expand Up @@ -152,6 +152,22 @@ public async Task RequestsTheCorrectUrl()
Args.Object);
}

[Fact]
public async void DoesNotFailWithAnArgumentNullExceptionValue()
{
var connection = Substitute.For<IConnection>();

var apiConnection = new ApiConnection(connection);

var client = new TeamsClient(apiConnection);

await client.AddMembership(1, "user");

connection.Received().Put<Dictionary<string, string>>(
Arg.Is<Uri>(u => u.ToString() == "teams/1/memberships/user"),
Arg.Is<string>(u => u == null));
}

[Fact]
public async Task EnsuresNonNullOrEmptyLogin()
{
Expand Down

0 comments on commit dfbd084

Please sign in to comment.