Commit Graph

16 Commits

Author SHA1 Message Date
Tom Longhurst
cd1835326b Fix xUnit Warnings (#2906)
* Fix xUnit Warnings

* Fix

* Fix formatting in AsyncPaginationExtensionGenerator.cs

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2024-04-15 13:19:26 -07:00
Jozef Izso
fc3e9c2cd2 Implement improved labels API (#1802)
* Implement new attributes for labels

* Include correct API header in all Labels calls

* Add integration tests for Create and Update methods for labels

* Use improved labels API in observable client

* found even more endpoints that need the preview header!

* RemoveFromIssue actually returns the list of remaining labels rather than null.  This change should be source compatible but not binary compatible

* Implement new labels search method in SearchClient

* Implement reactive client SearchLabels

* Improve documentation for label search methods

* more comment tidy up
2018-05-17 21:48:45 +10:00
Kristian Hellang
5ee4d64046 Add StringEnum to handle unknown enum values returned from API (#1595)
* Added StringEnum<TEnum>

* Added tests

* Make sure the serializer can work with StringEnum

* Use StringEnum for EventInfo.Event

* Add convention test to assert that all Response models use StringEnum<> to wrap enum properties

* Add Stringnum<> to all response types failing convention test

* Handle StringEnum to Enum conversion when Issue response model populates IssueUpdate request model

* Fix unit test

* Refactor SimpleJsonSerializer to expose the DeserializeEnum strategy so it can be used in StringEnum class

* Need to expose/use SerializeEnum functionality too, so we use the correct string representation of enum values that have custom properties (eg ReactionType Plus1 to "+1")

* fix unit tests, since the string is now the "correct" upstream api value

* Add a couple of tests for the Enum serialize/deserialize when underscores, hyphens and custom property attributes are present

* Compare parsed values for equality

* add convention test to ensure enum members all have Parameter property set

* update test to cover implicit conversions too

* this test should work but fails at the moment due to magic hyphen removal in deserializer causing a one way trip from utf-8 to EncodingType.Utf8 with no way to get back

* (unsuccesfully) expand event info test to try to catch more cases of unknown event types

* fix broken integration test while im here

* Fixed build errors after .NET Core merge

* Value -> StringValue, ParsedValue -> Value

* Don't allow StringValue to be null

* Ignore enums not used in request/response models

* Added ParameterAttribute to almost all enum values

* Ignore Language enum

* Fix failing tests

* Fix milestone sort parameter and tests

* whitespace

* fix milestone unit tests

* Fix StringEnum.Equals ... This could've been embarrassing!

* Change SimpleJsonSerializer Enum handling to only use `[Parameter()]` attributes (no more magic removal of hyphen/underscores from strings)

* Tidy up this integration test while im here

* Only test request/response enums in convention test

* Keep skipping Language

* Remove unused method

* Remove excluded enum types

* Removed unnecessary ParameterAttributes

* Remove unused enum

* Add StringEnum test for string-comparison of two invalid values

* Bring back IssueCommentSort and use it in IssueCommentRequest

This reverts commit 38a4a291d1476ef8c992fe0f76956974b6f32a49.

* Use assembly instead of namespace for Octokit check

* Add failing test to reproduce the issue where only the first enum paramter/value was added to the cache

* Fix deserializer enum cache to include all enum members rather than only the first member encountered

* Use a static SimpleJsonSerializer in StringEnum

* Remove serializer instance in StringEnum

* Add some documentation on StringEnum<TEnum>

* Fix parameter value to resolve failing integration test
2017-06-25 19:29:57 +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
aedampir@gmail.com
d796d17a71 added unit tests 2016-06-16 18:56:59 +07:00
Alexander Efremov
2ed5769154 Add ApiOptions overloads to methods on I(Observable)IssuesLabelsClient (#1329) 2016-05-29 15:32:48 +09:00
Brendan Forster
80719c0033 aaaand format the code 2015-11-04 13:38:51 -08:00
William Barbosa
1cb1258eb6 Refactors tests up to PullRequestsClientTests 2015-09-27 01:19:58 -03:00
Henrik Andersson
189ae42c3a Update tests 2015-03-24 00:12:54 +10:00
Haacked
a94051d6b0 Repository name is required when creating a repo
I was trying to create a repository and I wasn't sure which parameters
were required. Following our philosophy of exposing required parameters
in the constructor, I change the `NewRepository` object to take in a
repository name and to make that property readonly.
2015-03-19 16:25:03 -07:00
Brendan Forster
28e8372922 extract helper method for setting up GitHubClient 2015-01-04 10:03:45 +09:30
Brendan Forster
8e594db824 take care of initializing the labels array as late as possible 2014-10-12 08:46:18 -03:00
Tim Sneed
3909498437 Internalize ProductHeaderValue
What Haacked, PaulBetts, and Shiftkey suggested
2014-02-28 06:33:44 -06:00
Andre Rodrigues
18a3d3982b Apply more review comments 2013-12-06 15:35:43 +00:00
Andre Rodrigues
891a353e16 Add disposable 2013-12-06 09:46:28 +00:00
Andre Rodrigues
2ab931b541 Apply review comments 2013-12-06 09:14:40 +00:00