public async Task EnsuresNonNullArguments() { var connection = Substitute.For <IApiConnection>(); var client = new TeamsClient(connection); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, (TeamMembersRequest)null)); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, (ApiOptions)null)); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, null, ApiOptions.None)); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, new TeamMembersRequest(TeamRoleFilter.All), null)); }
public void RequestsTheCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new TeamsClient(connection); client.GetAllMembers(1); connection.Received().GetAll <User>(Arg.Is <Uri>(u => u.ToString() == "teams/1/members")); }
public void RequestsTheCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new TeamsClient(connection); client.GetAllMembers(1); connection.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "teams/1/members")); }
public void RequestsTheCorrectUrlWithRequest() { var connection = Substitute.For <IApiConnection>(); var client = new TeamsClient(connection); client.GetAllMembers(1, new TeamMembersRequest(TeamRoleFilter.Maintainer)); connection.Received().GetAll <User>( Arg.Is <Uri>(u => u.ToString() == "teams/1/members"), Arg.Is <Dictionary <string, string> >(d => d["role"] == "maintainer"), Args.ApiOptions); }
public void RequestsTheCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new TeamsClient(connection); client.GetAllMembers(1); connection.Received().GetAll <User>( Arg.Is <Uri>(u => u.ToString() == "teams/1/members"), null, "application/vnd.github.hellcat-preview+json", Args.ApiOptions); }