Skip to content

Commit

Permalink
Added tests for the observable teams client.
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Apr 22, 2014
1 parent 120b05b commit 6b15848
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Octokit.Tests.Integration/Octokit.Tests.Integration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<Compile Include="Helper.cs" />
<Compile Include="Clients\UsersClientTests.cs" />
<Compile Include="Reactive\ObservableUserEmailsClientTests.cs" />
<Compile Include="Reactive\ObservableTeamsClientTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Octokit.Reactive\Octokit.Reactive.csproj">
Expand Down Expand Up @@ -123,4 +124,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
43 changes: 43 additions & 0 deletions Octokit.Tests.Integration/Reactive/ObservableTeamsClientTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.Linq;
using System.Net;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Octokit;
using Octokit.Internal;
using Octokit.Tests.Helpers;
using Octokit.Tests.Integration;
using Xunit;
using System;
using System.Collections.Generic;
using Xunit.Sdk;
using Octokit.Reactive;

public class ObservableTeamsClientTests
{
public class TheGetMembersMethod
{
readonly Team team;

public TheGetMembersMethod()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests")) { Credentials = Helper.Credentials };

team = github.Organization.Team.GetAll(Helper.Organization).Result.First();
}

[OrganizationTest]
public async Task GetsAllMembersWhenAuthenticated()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};

var client = new ObservableTeamsClient(github);

var member = await client.GetMembers(team.Id);

Assert.Equal(Helper.UserName, member.Login);
}
}
}

0 comments on commit 6b15848

Please sign in to comment.