From dfbd084044b801e263a59505ab4aa8654387a944 Mon Sep 17 00:00:00 2001 From: David Alpert Date: Fri, 31 Jul 2015 13:12:49 -0500 Subject: [PATCH] failing test: TeamClient.AddMembership(..) using a real ApiConnection throws an ArgumentNullExceptionValue --- Octokit.Tests/Clients/TeamsClientTests.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Octokit.Tests/Clients/TeamsClientTests.cs b/Octokit.Tests/Clients/TeamsClientTests.cs index 52fbe985a8..c29a3d6091 100644 --- a/Octokit.Tests/Clients/TeamsClientTests.cs +++ b/Octokit.Tests/Clients/TeamsClientTests.cs @@ -8,7 +8,7 @@ namespace Octokit.Tests.Clients { /// - /// 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. /// public class TeamsClientTests @@ -152,6 +152,22 @@ public async Task RequestsTheCorrectUrl() Args.Object); } + [Fact] + public async void DoesNotFailWithAnArgumentNullExceptionValue() + { + var connection = Substitute.For(); + + var apiConnection = new ApiConnection(connection); + + var client = new TeamsClient(apiConnection); + + await client.AddMembership(1, "user"); + + connection.Received().Put>( + Arg.Is(u => u.ToString() == "teams/1/memberships/user"), + Arg.Is(u => u == null)); + } + [Fact] public async Task EnsuresNonNullOrEmptyLogin() {