Skip to content

Commit

Permalink
Trying to fix 1016
Browse files Browse the repository at this point in the history
  • Loading branch information
prayankmathur committed Mar 11, 2016
1 parent 0f5d7c4 commit 3f7e0a1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
30 changes: 28 additions & 2 deletions Octokit.Tests/Clients/EventsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ public void RequestsCorrectUrl()
}
}

public class TheGetAllIssuesForRepositoryMethod
{
[Fact]
public void RequestsCorrectUrl()
{
var connection = Substitute.For<IApiConnection>();
var client = new EventsClient(connection);

client.GetAllIssuesForRepository("fake", "repo");

connection.Received().GetAll<Activity>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events"));
}

[Fact]
public async Task EnsuresArgumentsNotNull()
{
var connection = Substitute.For<IApiConnection>();
var client = new EventsClient(connection);

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllIssuesForRepository(null, "name"));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllIssuesForRepository("", "name"));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllIssuesForRepository("owner", null));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllIssuesForRepository("owner", ""));
}
}
/*
public class TheGetAllForRepositoryMethod
{
[Fact]
Expand All @@ -38,7 +64,7 @@ public void RequestsCorrectUrl()
client.GetAllForRepository("fake", "repo");
connection.Received().GetAll<Activity>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/events"));
connection.Received().GetAll<Activity>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/events"));
}
[Fact]
Expand All @@ -53,7 +79,7 @@ public async Task EnsuresArgumentsNotNull()
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("owner", ""));
}
}

*/
public class TheGetAllForRepositoryNetworkMethod
{
[Fact]
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Clients/EventsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Task<IReadOnlyList<Activity>> GetAll()
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns>All the <see cref="Activity"/>s for the particular repository.</returns>
public Task<IReadOnlyList<Activity>> GetAllForRepository(string owner, string name)
public Task<IReadOnlyList<Activity>> GetAllIssuesForRepository(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Clients/IEventsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface IEventsClient
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns>All the <see cref="Activity"/>s for the particular repository.</returns>
Task<IReadOnlyList<Activity>> GetAllForRepository(string owner, string name);
Task<IReadOnlyList<Activity>> GetAllIssuesForRepository(string owner, string name);

/// <summary>
/// Gets all the events for a given repository network
Expand Down

0 comments on commit 3f7e0a1

Please sign in to comment.