-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ApiOption overloads to methods on IRepositoryPagesClient and IObservableRepositoryPagesClient #1213
Conversation
Ensure.ArgumentNotNull(options, "options"); | ||
|
||
var endpoint = ApiUrls.RepositoryPageBuilds(owner, repositoryName); | ||
return ApiConnection.GetAll<PagesBuild>(endpoint, null, AcceptHeaders.StableVersion, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to get away with just using the GetAll<T>
overload that takes endpoint
and options
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, my bad 😁
Have made the changes
…s well as Reactive methods and added tests
@shiftkey |
@prayankmathur looks like some tests need to be updated |
@prayankmathur you're right - I'll correct that and open a separate PR for it... |
@@ -31,7 +31,7 @@ public void RequestsCorrectUrl() | |||
} | |||
} | |||
|
|||
public class TheGetBuildsMethod | |||
public class TheGetAllBuildsMethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💄 this should be TheGetAllMethod
@prayankmathur this is looking good. We don't seem to have any integration tests for the |
@shiftkey |
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="repositoryName">The name of the repository</param> | ||
/// <param name="options">Options for changing the behaviour of the API</param> | ||
/// <remarks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraneous whitespace here? 2 spaces in ///..<remarks>
instead of 1.
Seems to be the case on a few of the xmldoc sections in multiple files in this PR
Also should the description of <param name="options">
be the same between observable and regular client concrete and interfaces? Currently across the 4 places, there are 3 different wordings
Options for changing the behaviour of the API
Options to change the behaviour of the API
Options to change the API response
@ryangribble
And i guess it should be same. |
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="repositoryName">The name of the repository</param> | ||
/// <param name="options">Options to change the API response</param> | ||
/// <remarks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
@ryangribble Please take a look. |
Looks good now. Yeah I realise often these little inconsistencies are already in the files, but whenever we are touching files I like to clean whatever we can up as we go 👍 |
@ryangribble |
@prayankmathur There is some code at places which is not covered by tests. I have encountered this situation in the TeamsClient also, so I think we should add tests wherever they are missing. |
Probably something that was missed at the time. Given this is a read-only interface it should be easy to use the Octokit.NET repository (or something similar) and craft some simple tests to get our coverage up... |
@shiftkey |
@shiftkey |
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get("owner", null)); | ||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, "name", new ApiOptions())); | ||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("owner", null, new ApiOptions())); | ||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("owner", "name", null)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a EnsuresNonEmptyArguments()
test function that passes ""
into the variuos parameters and ensures exceptions are thrown?
Ive made a couple of minor comments. Also it seems like there are no unit tests for
Im not too familiar with the |
@ryangribble @prayankmathur looks like there's some limitations with accessing the Pages API based on the docs:
This is going to cause headaches, and perhaps we need to do this setup:
This will likely mean most of the tests here are excessive... |
@shiftkey |
@prayankmathur that sounds great! Leave one test with an |
@shiftkey |
@prayankmathur it's defined in AppVeyor's config file - https://github.com/octokit/octokit.net/blob/master/appveyor.yml#L3-L7 |
I'm not sure what the current state of this PR is, so I'm moving this to #1304 so I can merge this new code in (with the skipped test). |
@shiftkey
@ryangribble
Refer #1178
Added the methods as well as tests (reactive methods too).