-
Notifications
You must be signed in to change notification settings - Fork 1
Add Admin controller and unit tests #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…curities, resetCache, resetDatabase, resetKuzzleData, resetSecurity, shutdown] and unit tests for method [dump]
Codecov Report
@@ Coverage Diff @@
## 0-dev #22 +/- ##
==========================================
+ Coverage 81.59% 82.78% +1.19%
==========================================
Files 18 20 +2
Lines 880 970 +90
Branches 107 118 +11
==========================================
+ Hits 718 803 +85
- Misses 155 160 +5
Partials 7 7
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## 0-dev #22 +/- ##
========================================
Coverage ? 82.81%
========================================
Files ? 20
Lines ? 972
Branches ? 118
========================================
Hits ? 805
Misses ? 160
Partials ? 7
Continue to review full report at Codecov.
|
| /// <summary> | ||
| /// Load roles, profiles and users into the storage layer. | ||
| /// </summary> | ||
| public async Task<bool> LoadSecuritiesAsync(JObject body, bool waitForRefresh = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You couldn't know that obviously, but routes returning the following kind of results: {acknowledge: true} will never have a false value. What it says is that the query is correctly formed and is thus accepted.
If something's wrong, the result part of the response will be null and the error part will be filled with the appropriate information.
So all methods wrapping API routes returning that kind of response must return a Task instead of a Task<bool>, because that boolean can never be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that thanks.
This has been changed to return Task instead of Task<bool>.
… because they are alway true
…harp into admin-controller
| [Theory] | ||
| [InlineData(false)] | ||
| [InlineData(true)] | ||
| public async void DumpAsyncTestSuccess(bool value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless acknowledge value theory: you forgot to change that when dropping the handling of the "acknowledge" response boolean value.
(this comment also applies to other tests below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the forgotten variables that i've used.
# [0.2.0](https://github.com/kuzzleio/sdk-csharp/releases/tag/0.2.0) (2019-07-17) #### New features - [ [#22](#22) ] Add Admin controller and unit tests ([Shiranuit](https://github.com/Shiranuit)) - [ [#23](#23) ] Add Index Controller ([alexandrebouthinon](https://github.com/alexandrebouthinon)) #### Enhancements - [ [#14](#14) ] Fix optional parameters design ([scottinet](https://github.com/scottinet)) - [ [#13](#13) ] Add unit tests for the collection controller ([scottinet](https://github.com/scottinet)) - [ [#12](#12) ] Add unit tests for the auth controller ([scottinet](https://github.com/scottinet)) - [ [#11](#11) ] Initialize unit tests project ([scottinet](https://github.com/scottinet)) #### Others - [ [#24](#24) ] Rewrite WebSocket class ([scottinet](https://github.com/scottinet), [alexandrebouthinon](https://github.com/alexandrebouthinon)) - [ [#20](#20) ] Add documentation runner ([Aschen](https://github.com/Aschen)) - [ [#18](#18) ] Add unit test for Realtime Controller ([ThomasF34](https://github.com/ThomasF34)) - [ [#17](#17) ] Unit tests kuzzle class ([Aschen](https://github.com/Aschen)) - [ [#16](#16) ] Add unit tests for the server controller ([ThomasF34](https://github.com/ThomasF34)) - [ [#15](#15) ] Add unit tests for the document controller ([scottinet](https://github.com/scottinet)) ---
What does this PR do ?
Add an Admin Controller wit the following methods from the API reference:
Add unit tests for every methods enumerated above
How should this be manually tested?
Run the following command :
dotnet test