Commit Graph

917 Commits

Author SHA1 Message Date
Mickaël Derriey
9c80b00e6f Merge master into dotnetcore (#1599)
* 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 :)

* Cloning ApiInfo object should work when some fields are null (#1580)

* Adjust ApiInfo.Clone() to work even if some elements (eg ETag) are null

* Remove c# 6 language feature and do it the old school way

* Add a test for cloning ApiInfo when some fields are null

* The 3 lists can never be null anyway so remove some un-needed statements

* Add test for null RateLimit

* Remove Rx-Main dependency from samples
This resolves #1592 - LINQPad doesn't understand how to restore this unlisted package and it's not actually needed in the samples.

* Adding RemovedFromProject and other missing EventInfoState types. (#1591)

* Adding missing review types to event info.

* Fixing whitespace.

* Reword `BaseRefChanged` comment

* Adding missing event types.

* Change response models 'Url' properties from `Uri` to `string` (#1585)

* Add convention test to ensure 'Url' properties are of type string

Closes #1582

* Change 'Url' properties from Uri to string

Global Find/Replace FTW!

* fix compilation errors in the integration tests project

* Extend 'Url' properties type check to request models

* Stick to convention tests naming convention

* Remove unused using directives in models

Changing from `Uri` to `string` means the `using System;`
directive was not needed anymore in some files

* Update exception message wording

* empty commit to trigger a new build - hopefully Travis passes

* add convention test to ensure request models have Uri 'Url' properties

* make request models 'Url' properties Uri

fix typo in convention test name

* revert some request models 'Url' properties as `string`

see https://github.com/octokit/octokit.net/pull/1585#issuecomment-297186728

* Change test so that all model types must have 'Url' properties of type string

 - Filter test input to only get types which have 'Url' properties
 - Merge response and request model types tests into one
 - Unparameterize the exception since we only check for the string type now

* Fix string.Format tokens

If this PR doesn't get rebased, it'll be my wall of shame FOREVER!

* and then it's even more embarrassing when the commit message says rebased but you really meant squashed

* Remove exclusion of `Release` from request models
2017-05-02 21:55:30 +10:00
Ryan Gribble
6be608b4ef Merge remote-tracking branch 'upstream/master' into dotnetcore
# Conflicts:
#	.travis.yml
#	Octokit.sln
#	appveyor.yml
2017-04-04 19:58:48 +10:00
Joen Sindholt
596e51d5b3 Surface exceptions in RepoCollaboratorsClient.Add method (#1576)
* Surface exceptions in RepoCollaboratorsClient.Add method

* Reintroducing try...catch but for NotFoundException

* Remove old/test dotnet core builds from appveyor
2017-04-03 22:34:43 +10:00
eriawan
32aa4e7443 Supply the call to ctor with anyreponame string parameter for unit test 2017-03-21 00:58:49 +07:00
Mickaël Derriey
13d5dab516 Port to .NET Core (#1503)
Port to .NET Core
2017-01-21 14:42:02 +10:00
Ryan Gribble
3c818934b8 Release v0.24 - A Sight For Sore Eyes (#1539)
* Add release notes and bump version to 0.24

* run "build FormatCode" to fix up whitespace/formatting issues

* Fix failing Ssh key tests due to "validation exception".  This key must be in use on github (under another user, most likely from these tests failing).  Changed to a new SSH key and tweaked tests to reduce chance of a key being created and not destroyed

* Assignee and Assignees cant both be specified on NewIssue.  We missed this one in the PR.  Marked Assignee as [Obsolete] and fixed tests to use Assignees

* Fix a couple of Reactions tests that were calling the wrong client methods

* Fix timeline tests - looks like the response class has changed shape a bit, it now has an Issue object in the payload and Id field isnt present (leaving Id field there in case other timeline events do use it)

* Fix some following tests that require the test user to follow more than 1 other user

* Unskip these Event tests now because apparently they work!

* add breaking changes notes

* Update ApiErrorMessageSafe to return null for empty and whitespace strings (#1540)

* return null if ApiError.Message is empty or whitespace

* Uncomment test, which now passes

* update release notes to include PR1540

* Add "Bot" AccountType, was causing a deserialization exception when running the integration test "SearchForExcludedLanguage" (#1541)

* Update to include PR1541

* add bullets to make release notes easier to read

* markup additional code mentions in notes

* Fix grammar

fields => field
2017-01-17 18:56:55 +10:00
Martin Scholz
b4fad9bfab Add multiple assignees to issues (#1339)
* [WIP]

* add new method to add assignees for an issue

* added new overloads

* added unit tests

* fixed missed overload calls

* fixed inconsistency in tests

* added integration tests

* fixed errors in tests

* fixed all remarks

* added new overloads

* added unit tests

* added integration tests

* fixed incorrect variable names

* added new overloads

* added unit tests

* added itegration tests

* fixed integration tests

* removed extra empty lines

* fixed errors in unit tests

* added overloads on IObservableReleasesClient and IReleasesClient

* added new unit tests

* added integration tests

* added Task as return value of unit tests

* added Task as return parameter

* added return value ReleasesClientTests

* another try to get tests work

* another one try

* undo prev commit

* fixed errors in tests

* removed extra ThrowsAsync checks

* added new overloads

* added unit tests

* added integration tests

* added integration tests

* Add ApiOptions overloads to IWatchedClient + tests.

* Add ApiOptions overloads to IObservableWatchedClient + tests.

* More tests.

* fixed error in ObservableWatchedClient

* added unit tests

* added integration tests

* added new overloads

* added unit tests

* added integration tests

* renamed "Ensures" methods to deliver more consistency in code

* fixed failed tests

* Add ApiOptions overloads to methods on I(Observable)IssuesLabelsClient (#1329)

* correcting a couple of tests (#1331)

* Add ApiOption overloads to methods on I(Observable)OrganizationsClient (#1324)

* Add ApiOptions overloads to methods on I(Observable)OrganizationMembersClient (#1332)

* fix description

* add new response for IssueAssignees

* add constructor for IssueAssignees

* add debugger display for NewAssignees

* add methods for observable assignees client; new unit tests

* add observable unit tests for add method

* place AddAssignees under IssueClient

* fix description

* [WIP] add generic delete method

* revert add assignees

* add assignees key under issue client

* remove IssueAssignees dependencies

* fix type IssueAssignees

* add remove method for issue assignees; finish generic delete method

* unit tests for remove assignees

* Add Assignees property to NewIssue and UpdateIssue requets
Add Asignees property to Issue response
Removed [SerializeNull] attribute from UpdateIssue.Assignee as this was causing it to remove assignee when none was specified
Add a couple of integration tests to prove Assignees are being deserialised

* rename NewAssignees to AssignessUpdate

* change Assignees key description

* check null Issue.ToUpdate method

* add accept header for IssuesClientTests

* Fix some more unit tests

* add integration test

Check if an assignee was added to an issue

* fix merge conflicts

* resolve conflicts

* implement some hints from @ryangribble

* resolve merge fixes

* clean up

* some more changes

* create new repo

Create a new repo for integrationtest
'CanRetrieveIssuesWithMultipleAssignees()'

* fix merge

* fix conflicts

* fix xml

* change test

* change delete overloads

* Fix tests

* fix xml

* Add helper function RemoveLabel

* Add helper function RemoveAssignee

* Format last commit

* Add integration tests to exercise new Assignees field on IssueUpdate

* GitHub API doesnt allow Assignee and Assignees properties to both be specified - API docs say that Assignee is deprecated so mark it [Obsolete] and dont populate it in Issue.ToUpdate()

* Add Assignees field to PullRequest response object, and integration tests to verify it is populated.
This field is not listed in the API docs but probing the API revealed it is included in payloads

* add a couple of extra tests to verify the IssueUpdate.Labels is working correctly

* Include assignees in ctor for consistency

* fix IssueUpdate test for new Assignees field
2017-01-11 22:53:41 +10:00
Park June Chul
cf0edddc30 Fix IssueCommentClient #1500 (#1501)
* Make GetAllForRepo to accept optional args

* Fix tests

* add missing interfaces

* fix tests

* Fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix

* fix tests

* fix tests
2017-01-07 23:42:05 +10:00
malamour-work
195de689ff Added a get all organizations method (#1469)
* Update IOrganizationsClient.cs

* Added the Uri for the organizations

Renamed the existing organizations uri to userOrganizations and created a new organizations uri.

* Implementation of the GetAllOrganizations

* Interface modification for the GetAllOrganizations

* Implementation of the GetAllOrganizations

* Created the tests for the two new methods

* remove new line

* Reverted the changes i did to the ApiUrls class to be backward compatible.
Created new client method and marked the old one [Obsolete] to be removed in a futur release.
Created a new request class to support the since attribute.
Updated the Unit Tests
Updated all the csproj to have the proper references.

* Renamed test

* Deprecated the Organizations method to be replaced by the new UserOrganizations method.

* Created 2 new test for the getAll method.
Renamed the existing one to make it clear they test the user organization.

* tweaks to integration tests
2016-11-21 23:54:27 +10:00
Jérémie Bertrand
88e5342562 Allow base64 content for create/update file (#1488)
* Allow base64 direct content for create/update file

* Add overload to avoid breaking change
2016-11-21 22:24:53 +10:00
Stanley Goldman
9265350af7 Additional test fixes 2016-10-16 14:12:17 -04:00
Brendan Forster
feb756182f Merge pull request #1477 from TattsGroup/repo-merge-options
Add repository settings to configure PR merge methods
2016-10-05 09:49:41 +11:00
Ryan Gribble
de3e809746 Revert merge method changes for New Repository as it is not supported by the github API
This reverts commit cf4c78c900
2016-10-05 07:52:49 +10:00
Ryan Gribble
cf4c78c900 Add new fields to NewRepository request and update RepositoriesClient.Create() method to specify preview accepts header and fix impacted unit tests
Add integration test for Create Repository with merge method specified
2016-10-05 07:51:34 +10:00
Ryan Gribble
3409ae11ff Add new ctor to PublicRepositoryRequest taking "since" parameter as a long, and obsolete the old ctor that uses an int
Update tests to pass long datatype
2016-10-03 20:45:43 +10:00
Ryan Gribble
e31ac8659a Add new fields to RepositoryUpdate request and update RepositoriesClient.Edit() method to specify preview accepts header and fix impacted unit tests
Also added some checking for RepositoryUpdate.Name being null, as it is a required parameter
2016-10-01 23:27:41 +10:00
Ryan Gribble
60537e1281 Update RepositoriesClient.Get() method to specify preview accepts header and fix impacted unit tests 2016-09-29 09:46:35 +10:00
Martin Scholz
a57fb1278d [WIP] Add repository traffic preview (#1457)
* Add response models

* Supress message

* correct spelling Timestamp

* implement traffic client

* add reactive client

* [WIP] unit tests

* add argument check

* finish unit tests

* add integration tests

* Change repositoryId from int to long
Remove GetAll naming of endpoints and add to PaginationTest exclusions
Rename View and Clone classes to be more specific
Add handling of TimeStamp fields being UtcUnix time
Add integration tests for repositoryId methods
2016-09-29 01:16:58 +10:00
Phil Haack
693cc29dd5 Code to test URL for an enterprise instance. (#1404)
* Code to test URL for an enterprise instance.

Based on code we use in GitHub Desktop for Windows.

* Add an example of the enterprise probe

* Add helpful constructor to EnterpriseProbe

* Suppress code analysis warning
Add xml comments to ctors and make consistent with GitHubClient/Connection etc

* Update getting started to use the new EnterpriseProbe ctor
2016-09-21 15:28:12 +10:00
Martin Scholz
93ae832311 [WIP] Protected branches updates - granular methods (#1443)
* Add get method for required status checks

* Add api urls for required status checks

* change name of apir url for required status checks

* fix xml comment

* add update method for required status checks

* add delete method for required status checks

* fix api url

* fix xml comment

* add api url for required status cehcks contexts

* add get method for required status checks contexts

* add replace method for required status checks contexts

* add add method for required status checks contexts

* add new overload for delete method

* add delete method for required status checks contexts; fix overloads for delete

* add api url for restrictions

* add get method for restrictions

* add delete method for restrictions

* add api url for teams restrictions

* add get method for team restrictions; fix delete method restrictions

* fix overhead for get team restrictions

* fix httpmethod for update required status checks

* add set method for team restrictions

* add add method for team restrictions

* add delete method for team restrictions

* add api url for user restrictions

* add get method for user restrictions

* add set method for user restrictions

* add add method for user restrictions

* add delete method for user restrictions

* Add unit test; fix api urls

* Add ExcludeFromTest class

* add exclude attribute to methods

* Add attribute usage

* Add parameter to interface

* add observable unit tests

* rename excludefromtest

exclude all the tests for the new api endpoints because they broke the
pagination and syncobsverable tests.

* rename excludefromattribute

* refactor observable methods

* [WIP] Add integration tests

* finish integration test

* fix renamed branch protection restrictions

* add team and user collections

* rename set to update

* rename test methods

* optimize integration tests

* made some tidy ups
- fixup comment wording Edit => Replace
- remove spurious characters from description
- remove un-needed exclude attributes

* remove ForOrgRepo tests

* remove unused org contexts

* dispose contexts

* remove obsolete GetRedirect

* add clarifying comment to restriction methods
2016-09-21 07:16:51 +10:00
Brendan Forster
6a21ce5df6 Merge pull request #1445 from shana/change-int-to-long
Change repository id from int to long
2016-09-16 11:20:50 +10:00
Andreia Gaita
9e958bf998 Make Repository Id a long, it's going to grow... 2016-09-15 02:15:11 +02:00
aedampir@gmail.com
3bde78b260 changed C# -> CSharp
tests refined
removed unsed usings
2016-09-12 13:59:31 +07:00
Ryan Gribble
51e2380d70 debug implementation while writing integration tests
- fix Update method PUT parameters
- add [SerializeNull] to various request fields
- fix deserialize problem with ProtectedBranchRestrictions ctor not being public
- tidy up DebuggerDisplay output
2016-08-10 14:23:48 +10:00
Ryan Gribble
2c7d6fbe42 push restrictions only apply to org repos so provide a ctor for the update request that doesnt take a restrictions parameter 2016-08-08 23:28:20 +10:00
Ryan Gribble
3bd7323044 Add comments, move request classes to new file 2016-08-08 23:25:52 +10:00
Ryan Gribble
466d0763d2 First cut at adding Get/Update/Delete methods for branch protection
So far only non reactive client and unit tests
2016-08-08 22:09:12 +10:00
Ryan Gribble
ef0da2f84d Create RepositoryBranchesClient (#1437)
* Tidy up location of existing EditBranch tests

* Create RepositoryBranchesClient and move the GetBranch GetAllBranches and EditBranch methods to it, obsoleting the old ones

* Add tests for the new RepositoryBranchesClient (keeping old tests for RepositoriesClient around for now)

* Disable obsolete warning on reactive client temporarily

* Create observable repository branches client and move GetBranch, GetAllBranches, EditBranch methods to it, obsoleting the old ones

* Add tests for observable repository branches client, leave old tests in place for now

* Fix projects...

* Fix whitespace
2016-08-08 22:00:37 +10:00
Henrik Andersson
23d9310133 Implement Issue Timeline preview API (#1435)
* Implement Issue Timeline preview API

* Add DebuggerDisplay to response models

* Rename method

* Add Observable Issue Timeline client

* Add that missing property thing

* Add teh comments

* Added unit tests

* Fix method names

* Add missing event type enum and API preview accept header

* Add integration tests for async client

* Pass in API preview header

* Add observable integration tests

* Unbreak the broken tests...

* Remove unnecessary usings

* Add missing events

* Fix API URLs

* Add overloads for using repository Id instead of owner/repo and paging

* Add tests for repository id overloads

* Add paging tests

* I'm clearly a bit rusty about this test thing here...

* Missed a check for null argument

* Added missing XMLDocs
2016-08-08 07:51:07 +10:00
Martin Scholz
89500f4b8a Repository invitations changes (#1410)
* add invitations accept header

* create class RepositoryInvitation

* add repository invitations client

* add api urls for invitations

* [WIP]

* add methods to repository invitations client

* add invite method to repo collaborators client

need to add some new overload to post method in apiconnection

* some changes

* add observable client

* add dependings

* add missing observable client

* add missing xml params

* check client

* change repository invitation model

* [WIP] tests

* [WIP] tests; fix overloads for client

* change GetAllForCurrent; suppress message

* some more tests

* [WIP]

* [WIP]

* add collaborator request model

* change return types

change return types for invitation methods. add permission attribute for
repository collaborators invite method.

* add some more tests

* fix xml doc

* check for null arguments

* fix tests

* some fixes from @ryangribble

* add parameterless constructor for RepositoryInvitation

* change setter

* change constructor

* fix merge conflicts

* [WIP] RepositoryInvitationsClientTests

* fix api url xml

* change collaborator request constructor

* change unit tests for collaborator request

* change repocollaboratorsclient

change overloads for add in invite methods to set permissions

* [WIP] integration tests

* add methods for interface

* NotFoundExceptions

* add overload for invite method

* rename repo property

* gramar

* overloads for observable repo collaborators client

* change integration tests

* new integration tests

* add decline test

* add test for accept invitation
2016-07-23 18:50:22 +10:00
Brendan Forster
f7a4bac040 Merge pull request #1421 from dampir/fix1416
GitHub Pages Preview API Enhancements
2016-07-17 07:59:20 -07:00
aedampir@gmail.com
992ff0dad4 fixed errors in tests 2016-07-17 11:34:02 +07:00
Ryan Gribble
9d8e8ae8af Remove obsolete items - SshKey
- SshKeysClient
- SshKey
- SshKeyInfo
- SshKeyUpdate
2016-07-16 22:46:42 +10:00
Ryan Gribble
016e25b693 Remove obsolete items - AuthorizationClient
- RevokeAllApplicationAuthentications()
2016-07-16 22:46:38 +10:00
Brendan Forster
c25ba887b8 Merge pull request #1360 from dampir/add-repo-id-commit-status-client
Add repositoryId overloads to methods on I(Observable)CommitStatusClient
2016-07-14 08:32:21 -07:00
Brendan Forster
b07ce6e11a Merge pull request #1356 from dampir/add-repo-id-repo-forks-client
Add repositoryId overloads to methods on I(Observable)RepositoryForksClient
2016-07-14 08:32:11 -07:00
aedampir@gmail.com
d83342fdbf added new unit tests 2016-07-14 20:59:36 +07:00
aedampir@gmail.com
d0dc6dbd92 added new null checks 2016-07-14 10:16:50 +07:00
Sarmad
7818195f11 little argument fix 2016-07-13 21:12:42 +05:00
Sarmad
032cf936b6 Updated Git Data Tag With Signature Verification 2016-07-13 20:13:33 +05:00
Brendan Forster
6f3c8c4314 Merge pull request #1357 from dampir/add-repo-id-repo-pages-client
Add repositoryId overloads to methods on I(Observable)RepositoryPagesClient
2016-07-12 11:14:06 -07:00
Brendan Forster
fde368256d Merge pull request #1362 from dampir/add-repo-id-blobs-client
Add repositoryId overloads to methods on I(Observable)BlobsClient
2016-07-12 11:14:01 -07:00
Brendan Forster
57fb2ef8f4 Merge pull request #1363 from dampir/add-repo-id-tags-client
Add repositoryId overloads to methods on I(Observable)TagsClient
2016-07-12 11:13:54 -07:00
aedampir@gmail.com
8e735387d1 fixed errors in tests 2016-07-12 10:11:25 +07:00
aedampir@gmail.com
0e96778929 added new unit tests 2016-07-12 09:07:25 +07:00
Martin Scholz
72e30a7f90 Add reactions to issue, commit comment and review payload (#1405)
* add reactions to issue response payload

* add reactions to commit comment payload

* add reactions to review comment payload

* create tests for issue client

* tests for commitcomment client

* tests for pull request review comment

* change observable tests

* simplify strings

* remove unnecessary clients

* change integration tests to retrieve all reaction types

* create integration test for issue comment client

* fix merge conflicts

* fix merge conflicts

* gets tests passing again

* fix some reaction integration tests

* Fixup unit tests wth preview accepts header
Also applied preview header to a couple of repositoryId based calls that were added by another PR

* Fixup unit tests wth preview accepts header
Also applied preview header to a couple of repositoryId based calls that were added by another PR

* Rework reaction payload tests for IssueComments to handle Get, GetAllForIssue and GetAllForRepository calls

* [WIP] reaction payload tests

* Rework reaction payload tests for IssueComments to handle Get, GetAllForIssue and GetAllForRepository calls

* Rework reaction payload tests for Issues client

* Rework reaction payload tests for PullRequestReviews client

* Rework reaction payload tests for CommitComments client

* Revert "[WIP] reaction payload tests"

This reverts commit a6179b0f21a3ddfe36bfd3ae5eafae0e69b52252.
2016-07-08 20:29:08 +10:00
Brendan Forster
3e18580de2 Merge pull request #1379 from dampir/add-repo-id-issue-comments-client
Add repositoryId overloads to methods on I(Observable)IssueCommentsClient
2016-07-07 13:47:22 +10:00
Brendan Forster
7453899b51 Merge pull request #1380 from dampir/add-repo-id-issues-client
Add repositoryId overloads to methods on I(Observable)IssuesClient
2016-07-07 10:26:33 +10:00
Brendan Forster
a25e537f3b Merge pull request #1369 from dampir/add-repo-id-tree-client
Add repositoryId overloads to methods on I(Observable)TreesClient
2016-07-07 10:19:47 +10:00
Brendan Forster
6f22b7197a Merge pull request #1371 from dampir/add-repo-id-statistics-client
Add repositoryId overloads to methods on I(Observable)StatisticsClient
2016-07-07 10:09:53 +10:00