bugfix - PUT should have a payload for Mark as Read (#1579)

* bugfix - PUT should have a payload for Mark as Read

* also fix the Observable client test

* add integration tests for MarkRead methods

* Fixup MarkReadForRepository methods to specify a body in the PUT request

* Fix unit tests for regular and observable client

* helps if the new files are included in the test project :)
This commit is contained in:
Brendan Forster
2017-04-13 18:04:04 +10:00
committed by Ryan Gribble
parent 596e51d5b3
commit f6154dac9f
6 changed files with 95 additions and 9 deletions
@@ -0,0 +1,41 @@
using System.Threading.Tasks;
using Octokit.Tests.Integration;
using Xunit;
public class NotificationsClientTests
{
public class TheMarkAsReadMethod
{
[IntegrationTest]
public async Task MarksNotificationsRead()
{
var github = Helper.GetAuthenticatedClient();
await github.Activity.Notifications.MarkAsRead();
}
}
public class TheMarkAsReadForRepositoryMethod
{
[IntegrationTest]
public async Task MarksNotificationsRead()
{
var owner = "octokit";
var repo = "octokit.net";
var github = Helper.GetAuthenticatedClient();
await github.Activity.Notifications.MarkAsReadForRepository(owner, repo);
}
[IntegrationTest]
public async Task MarksNotificationsReadForRepositoryId()
{
var repositoryId = 7528679;
var github = Helper.GetAuthenticatedClient();
await github.Activity.Notifications.MarkAsReadForRepository(repositoryId);
}
}
}
@@ -98,6 +98,7 @@
<Compile Include="Clients\IssuesEventsClientTests.cs" />
<Compile Include="Clients\MigrationsClientTests.cs" />
<Compile Include="Clients\MilestonesClientTests.cs" />
<Compile Include="Clients\NotificationsClientTests.cs" />
<Compile Include="Clients\OrganizationClientTests.cs" />
<Compile Include="Clients\OrganizationMembersClientTests.cs" />
<Compile Include="Clients\PullRequestReviewCommentReactionsClientTests.cs" />
@@ -157,6 +158,7 @@
<Compile Include="Reactive\ObservableFollowersClientTests.cs" />
<Compile Include="Reactive\ObservableGistClientTests.cs" />
<Compile Include="Reactive\ObservableIssueTimelineClientTests.cs" />
<Compile Include="Reactive\ObservableNotificationsClientTests.cs" />
<Compile Include="Reactive\ObservableRepositoryDeployKeysClientTests.cs" />
<Compile Include="Reactive\ObservableAssigneesClientTests.cs" />
<Compile Include="Reactive\ObservableAuthorizationsClientTests.cs" />
@@ -0,0 +1,43 @@
using System.Reactive.Linq;
using System.Threading.Tasks;
using Octokit.Reactive;
using Octokit.Tests.Integration;
using Xunit;
public class ObservableNotificationsClientTests
{
public class TheMarkAsReadMethod
{
[IntegrationTest]
public async Task MarksNotificationsRead()
{
var client = new ObservableGitHubClient(Helper.GetAuthenticatedClient());
await client.Activity.Notifications.MarkAsRead();
}
}
public class TheMarkAsReadForRepositoryMethod
{
[IntegrationTest]
public async Task MarksNotificationsRead()
{
var owner = "octokit";
var repo = "octokit.net";
var client = new ObservableGitHubClient(Helper.GetAuthenticatedClient());
await client.Activity.Notifications.MarkAsReadForRepository(owner, repo);
}
[IntegrationTest]
public async Task MarksNotificationsReadForRepositoryId()
{
var repositoryId = 7528679;
var client = new ObservableGitHubClient(Helper.GetAuthenticatedClient());
await client.Activity.Notifications.MarkAsReadForRepository(repositoryId);
}
}
}