Commit Graph

13 Commits

Author SHA1 Message Date
Ryan Gribble b7ad64d92f Remove obsolete members (#1622)
* remove obsolete "Branches" methods from RepositoryClient (all were previuosly moved to RepositoryBranchesClient)

* Remove obsolete DeploymentStatus fields

* Remove obsoleteMergePullRequest.Squash parameter

* Remove obsolete request ctor

* Remove tests

* Not sure how I missed these test references
2017-06-27 08:50:31 +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 4a67f19ced Add some xmldoc for the PullRequestMergeMethod enum and values 2016-09-29 12:49:26 +10:00
Ryan Gribble 37048d106b Add MergeMethod property to PR merge request
Obsolete the previous Squash property
Add integration tests for each method
2016-09-29 12:32:13 +10:00
Sarmad 3f3930253c Pull-Request-Squash-Commit (#1245) 2016-05-20 11:34:41 +03:00
aedampir@gmail.com 695cf8e75b Unused "using" directives were removed in whole solution. 2016-03-25 13:38:07 +07:00
Mordechai Zuber 44304ca70b use string per recommended style 2015-12-16 21:23:36 +02:00
Haacked 870a4e817a Rename Message to CommitMessage
According to the docs
(https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button),
this should be sent as "commit_message" thus we need to name it
`CommitMessage`
Fixes #913
2015-09-27 14:45:11 -07:00
Henrik Andersson d8cef691b7 Add SHA and make message optional 2015-05-19 07:53:01 +10:00
Amy Palamountain d35a6eea89 Hot.Doge Debugger display! 2014-02-20 21:50:23 +13:00
Josh Sullivan c1e6d1e6bd Patched up some issues from the upstream merge.
Removed default parameter from pull request merge message according to
CA1026.
2014-02-03 18:31:09 +11:00
Josh Sullivan 6c7f75656b Merge comments default to an empty string as they are optional. 2014-02-03 18:31:09 +11:00
Josh Sullivan fddae25b6f Implemented pull request merge functionality 2014-02-03 18:31:08 +11:00