67 Commits

Author SHA1 Message Date
skyemcleman
41d5d240ec feat: Add create organization invitation via email (#2895)
* Add API request to create org invitation

* Add tests for create org invitation

* Add IObservable API request to create org invitation

* Add tests for IObservable create org invitation
2024-03-11 13:02:31 -05:00
Pavel Kindruk
57a29e90d0 [Bug]Fix pagination when ApiOptions.StartPage is explicitly set. 2023-09-22 09:09:37 -05:00
Yankai
66587ee0d1 [feat] Add Response caching 2023-02-07 11:35:54 -06:00
minoura-a
6c11c1edff [bug]: Fixed a bug that content cannot be retrieved if "#" is included in a file or folder name. 2022-11-23 11:13:29 -06:00
Chris Simpson
bc156af4e6 maint: Fixing the use of the binary formatter in net461 so all unit tests now pass. (#2535) 2022-08-09 09:04:06 -05:00
Chris Simpson
2f7bd00dd6 feat: Removing accept header previews (#2515) 2022-08-01 09:37:23 -05:00
Brendan Forster
287861e4a7 rewrite the setup of responses to use a standard helper function (#2177) 2020-04-14 11:30:15 -03:00
Brendan Forster
4b0e7255b1 remove all usages of TaskFactory in test suite (#2164) 2020-03-31 16:57:16 -03:00
Cédric Luthi
c94cd05b8b Obsolete UnixTimestampExtensions methods (#2121)
* The equivalent of `public static DateTimeOffset FromUnixTime(this long unixTime)` exists in the framework since .NET Framework 4.6: https://docs.microsoft.com/en-us/dotnet/api/system.datetimeoffset.fromunixtimeseconds
* The equivalent of `public static long ToUnixTime(this DateTimeOffset date)` exists in the framework since .NET Framework 4.6: https://docs.microsoft.com/en-us/dotnet/api/system.datetimeoffset.tounixtimeseconds
2020-03-03 09:30:30 -04:00
Brendan Forster
45bc5eced7 autofix tests based on feedback from xunit analyzers (#1997) 2019-09-16 19:46:40 -03:00
Ryan Gribble
4df21a61de Implement Check Suites API (#1846)
* Check run request models

* Check Run response models

* Check run clients

* Check run ApiUrls and AcceptHeaders

* Pack it all together for now

* Add missing accept headers to connection calls

* Standardize class definitions

* Standardize function names

* Merge ICheckRunAnnotationsClient into ICheckRunsClient

* Properly organize clients

* Cleanup CheckRun response model

* Fix slug check run urls

* Add checks installation permission

* Use StringEnums where appropriate

* Cleanup check run output models

* Flesh out CheckSuite model

* Delete CheckRunsList

* Remove a sealed, fix some line endings

* Adding check suite models

* Skeleton check suite client implementation

* Add check suite ApiUrls

* Flesh out check suites client

* Add parameterless CheckRun constructor

* Add DebuggerDisplay to checks models

* Add observable checks interfaces

* Add return values to POST and PATCH check clients

* Fix some check suite client return values

* Skeleton reactive checks implementation

* Implement observable checks clients

* Remove rogue tabs

* Add CheckSuiteEventPayload

* Add CheckRunEventPayload

* Add DebuggerDisplay attributes to checks API payloads

* Properly nullables check suite/run conclusion

* Add CheckSuiteEventTests

* Fix checks client accessor naming issues

* Add missing Text field to CheckRunOutput

* Marks CheckRunUpdate's conclusion as nullable

* Fix reactive checks client naming

* Today I learned DateTimeOffset is a struct

Makes CheckRunUpdate's DateTimeOffsets nullable

* Modify check clients to put slug version before repo id version

* Add nullable to CheckRun.CompletedAt

* Implement parameterless ICheckRunsClient.GetAllForReference and GetAllForCheckSuite

* Add missing RequestParameters base to CheckSuiteRequest

* Implement checks API GetAll methods

* Bring parity to Reactive checks clients

* fix project settings to get GitHubApp helper working again

* remove un-needed InstallationId setting - provide helper method to find installation based on owner

* fix up request object ctors based on required/optional parameters

* fix up request object ctors based on required/optional parameters

* add some initial integration tests for CheckSuites and CheckRuns including some helper methods

* Add test for Request CheckSuite
Fix Request CheckSuite to use correct Uri
Fix Request CheckSuite return type as it doesnt return an object
Fix CheckSuiteTriggerRequest ctor to make required fields mandatory

* simplify Get CheckSuite test to not require as much data setup

* Add test for CheckSuite GetAllForReference

* Add test for CheckSuite UpdatePreferences

* rename response models

* rename CheckSuitesList to CheckSuitesResponse and use as response to the GetAll calls

* Fix tests

* Fix observable

* fix model convention tests

* remove CheckRuns so we can focus only on CheckSuites for now

* naming things is hard

* oh so many unit tests for CheckSuites methods

* make client mockable

* Fix issue with .Max() when no results returned

* fix request parameter names

* add Xml doc comments

* Add XmlDoc comments to request/common model objects

* rename class to match usage

* tidy ups

* xmldoc for observable clients

* fix method order

* add observable unit tests and get them passing

* Add Observable unit tests and get them passing

* add observable integration tests

* tidy up ApiUrl method name

* whitespace/using tidy ups

* Ensure CheckSuiteEventPayload class is handled in deserializer and add to activity test

* add response model XmlDoc comments

* missed one xmldoc

* add xmldoc to NewCheckSuite request and remove HeadBranch property as it doesnt exist anymore

* add some extra check suites integration tests
2018-07-14 20:01:41 +10:00
mkArtak
6577c3ccba Enable support for milestone-based issues queries (#1788)
* Added support for Milestone filter in SearchIssuesRequest

* Fixed some styling issues to match with the style of the existing code

* Wrap milestone value with double quotes as milestones can contain spaces

* Allow milestone filter to contain double quotes

* Ability to search by milestone exclusions

* Moved the EscapeDoubleQuotes method to StringExtensions
2018-03-28 16:45:51 +10:00
Jozef Izso
270356b5b4 Fixes #1586 - Repository license API (#1630)
* Implement GetLicenseContents() method for getting repository's license info

* Request License Preview API for calls that return Repository object.

* Add missing accept headers to observable methods for ObservableRepositoriesClients

* fix impacted unit tests
2018-01-19 19:43:46 +10:00
Ryan Gribble
bc7830fc6e Fix OAuthClient to work correctly with GitHub Enterprise instances (#1726)
* Add more test cases for GetGitHubLoginUrl tests

* Fix enterprise authorize Urls by replacing the existing relative Uri segment (/api/v3) instead of appending to it via an extension method

* Add tests for new ReplaceRelativeUri extension method

* add test for GHE URL on oauth CreateAccessToken

* move away from class level consts

* Oauth client can store stripped base URL so it works with GHE
2018-01-05 07:02:26 +10:00
Ryan Gribble
5e89232521 Release v0.25 - She'll be Comin' Round the Mountain (#1656)
* Run `build -Target FormatCode` to fixup whitespace etc

* Fix delete release asset integration test

* Fix repository fork test

* Fix pagination test for PR Review Request

* First cut of release notes

* update release notes

* Update release notes

* include links to contributors

* Add breaking changes/advisories section

* Tidy up formatting

* Tidy up wording
2017-08-23 21:27:15 +10:00
Ryan Gribble
635b42d735 Fix Uri.ApplyParameters() to handle relative Uri's that have existing parameters (#1649)
* Expand ApplyParameter() tests to reveal failure case (relative URI with existing query parameters)

* Ensure new Uri is created from base Uri without existing parameters present
2017-08-08 14:07:14 +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
Elhamer
a44feaa7c3 Add ApiOption overloads to methods on IGistsClient (#1261) 2016-04-19 08:16:42 +10:00
aedampir@gmail.com
7f5d446ea8 Redundant commas in object initializers were removed. 2016-03-24 23:12:12 +07:00
Brendan Forster
03ea831489 implemented IReleaseClient.GetAll with overloads to take ApiOptions 2016-02-14 16:56:36 +11:00
Mordechai Zuber
44304ca70b use string per recommended style 2015-12-16 21:23:36 +02:00
Brendan Forster
80719c0033 aaaand format the code 2015-11-04 13:38:51 -08:00
Kristian Hellang
7162ce6e72 Clarify why convention tests are failing 2015-09-22 10:54:02 +02:00
Naveen
f000980b8d Update StringExtensionsTests.cs
Update StringExtensionsTests.cs  for the URL expansion. The initial fix was incorrect.
2015-09-16 19:29:56 -04:00
Naveen
4cde5cdf90 Fix for Upload to Github releases stopped working #894
Fix for Upload to Github releases stopped working #894. The
ExpandUriTemplate could handle only one parameter which is the bug.
2015-09-16 11:18:19 -04:00
Haacked
6179361ed9 Add tests for UnixTimestampExtensions
Also refactored the code to be a bit easier to understand and have less
calculations.
2015-08-07 16:02:20 -07:00
Mordechai Zuber
eed94b4dd2 🔥 AssertEx.Throws 2015-05-19 12:07:46 +03:00
Mordechai Zuber
b9b447b472 Helpers 2015-05-19 12:06:29 +03:00
Mordechai Zuber
4f0bfe4b62 Add Obsolete attribute to AssetEx.Throws helper method 2015-05-11 12:24:47 +03:00
Kristian Hellang
273ad8acdc Added test for readonly collections 2015-03-18 11:43:47 +01:00
Haacked
7fdbbf0ae3 Merge branch 'master' into haacked/api-response-refactor
Conflicts:
	Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs
	Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs
	Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs
	Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs
	Octokit/Octokit-Mono.csproj
	Octokit/Octokit-MonoAndroid.csproj
	Octokit/Octokit-Monotouch.csproj
	Octokit/Octokit-Portable.csproj
	Octokit/Octokit-netcore45.csproj
2015-01-18 12:35:17 -08:00
Kristian Hellang
b088b3f544 Added asserts for DebuggerDisplay value and property 2015-01-06 08:52:09 +01:00
Haacked
53a6516de2 Change IResponse.Body to object
This removes the awkward Body and BodyAsObject property combo we used to
have.
2015-01-04 19:06:50 -08:00
Haacked
1dd42ec4c8 Use IReadOnlyList instead of IReadOnlyCollection or IEnumerable
For response models.
2015-01-04 14:28:06 -08:00
Brendan Forster
2b2fa1c5e3 four of them pass 2014-12-14 21:47:39 +09:30
Brendan Forster
7d545754a7 one project builds 2014-12-14 21:37:57 +09:30
Haacked
1b4d02b142 Ensure no async void methods
Added self tests to find async void methods. It found some cases where
we passed an async lambda to a method that did not accept Action<Task>
or Func<Task>. I fixed those tests.
2014-11-07 16:05:53 -08:00
Brendan Forster
001c5ac564 Merge remote-tracking branch 'vktr/org-edit' 2014-07-11 09:33:03 +09:30
Viktor Elofsson
f852b70fc9 Merge of upstream master. 2014-07-01 10:11:08 +02:00
Henrik Andersson
7f9429b8e9 Added unit tests 2014-06-15 08:34:39 +10:00
Brendan Forster
c600ce832c added tests to catch regression 2014-04-30 14:52:37 +08:00
Haacked
d7a69e20d7 Implement OAuth Web Flow
Provide methods to make it easy for developers to implement the
web flow.

https://developer.github.com/v3/oauth/#web-application-flow
2014-04-19 16:01:35 -07:00
Haacked
b56613b99b Await calls with try/catch
In 451eddc647 we were a little overzealous
in removing async/await calls. Anywhere we do a try/catch around a
method that returns a Task, we need to use await.
2014-03-21 13:56:29 -07:00
Haacked
5430718c58 Add custom assert for readonly collection 2014-02-26 23:15:10 -08:00
Amy Palamountain
2e1fcd73bc Added is any cancellation token argument 2014-02-16 17:04:53 +13:00
Peter MacNaughton
a9b9358836 Merge branch 'master' of https://github.com/octokit/octokit.net into deployments_client 2014-02-10 20:15:52 -07:00
lbargaoanu
d3106e487b better diagnostics 2014-02-10 15:23:10 +02:00
Peter MacNaughton
f0f6a96686 Merge branch 'master' into deployments_client 2014-02-08 22:20:44 -07:00
lbargaoanu
d2aff11d5c check for DebuggerDisplay on models 2014-02-07 10:50:36 +02:00
Peter MacNaughton
2e9263009d Fixing argument tests for ObservableDeployments...
Client and ObservableDeploymentStatusClient. Needed to make sure that
the tasks were actually run and not just scheduled.
2014-02-02 18:25:49 -07:00