Commit Graph

21 Commits

Author SHA1 Message Date
Chris Simpson 2f7bd00dd6 feat: Removing accept header previews (#2515) 2022-08-01 09:37:23 -05:00
Brendan Forster 5de5258257 add attribute for tracking preview usage in the codebase (#2128) 2020-03-07 10:40:15 -04:00
Brendan Forster ce5ea64428 migrate to dotnet-format tool (#2016)
* migrate to new dotnet-format tool in build script (run on local build)
* reformat code
2019-09-24 11:34:50 -03:00
Henrik Andersson 9e5a76886f Add ability to specify 'since' request parameter to issue comments (#2008)
* Update issue comments client to allow returning comments 'since' a specific date

* Update observable issue comments client to allow returning comments 'since' a specific date

* Add test cases to cover newly added methods
2019-09-21 13:17:14 -03: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
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
aedampir@gmail.com 567220c28b fixed error in tests 2016-07-07 03:35:03 +07:00
aedampir@gmail.com eb8062d1a1 added new unit tests 2016-06-15 20:03:36 +07:00
Henrik Andersson 2009e5a417 Fix tests, observable unit tests and convention tests 2016-06-15 16:21:56 +10:00
Alexander Efremov db839f58d4 Redundant braces of argument list were removed (#1277) 2016-04-21 16:23:42 +10:00
aedampir@gmail.com 36c08248fa New convention test was added. Now each "TheCtor" class must have "EnsuresNonNullArguments" method were throwing of ArgumentNullException from client constructor class should be tested.
All unused "using" directives were removed.
2016-04-18 12:51:35 +07:00
Elhamer 9c77ebf009 Add ApiOption overloads to methods on IIssueCommentsClient (#1267) 2016-04-14 14:07:19 +10:00
Brendan Forster 80719c0033 aaaand format the code 2015-11-04 13:38:51 -08:00
Mordechai Zuber cc2839bfe6 O-Followers, O-Gists, O-IssuesComments 2015-05-19 11:29:10 +03:00
Henrik Andersson 189ae42c3a Update tests 2015-03-24 00:12:54 +10:00
Paul Betts d731f1bd97 More jacked up tests 2014-04-30 21:47:34 -07:00
Peter MacNaughton b8c18e2da6 Fixing some unit tests that were not doing
any assertions.
Adding Received() where it was missing.
The majority of these instances were unawaited AssertEx.Throws
They are now all either awaited or replaced with Assert.Throw
Assert.Throw was used when possible and when not an option
AssertEx.Throw was awaited.
2014-02-09 01:12:31 -07:00
Haacked 9b31f9298e Fix broken unit tests 2013-11-04 15:50:46 -08:00
pltaylor 1dd76c766b Finish adding tests. 2013-11-04 14:51:21 -05:00
pltaylor 7d9fbd10ee Add first tests and make public 2013-11-04 14:44:06 -05:00