-
Notifications
You must be signed in to change notification settings - Fork 39
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
Removing Moq as a dependency for mock unit tests #168
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #168 +/- ##
==========================================
+ Coverage 93.99% 94.03% +0.03%
==========================================
Files 82 82
Lines 5080 5080
Branches 479 479
==========================================
+ Hits 4775 4777 +2
+ Misses 177 176 -1
+ Partials 128 127 -1 ☔ View full report in Codecov by Sentry. |
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.
Just a minor inconsistency in variable declaration.
//arrange | ||
var conn = redisFixture.Redis; | ||
var db = conn.GetDatabase(); | ||
IJsonCommands commands = new JsonCommands(db); |
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.
Inconsistent use of var
/type declaration - intended?
//arrange | ||
var conn = redisFixture.Redis; | ||
var db = conn.GetDatabase(); | ||
IJsonCommandsAsync commands = new JsonCommands(db); |
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.
Inconsistent use of var
/type declaration. Same as above.
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.
If we use var then commands
will be of type JsonCommands
and not IJsonCommands
.
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.
What about using the JsonCommandsAsync
constructor instead of casting?
That would make it a bit more explicit.
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 just tested locally and it works properly even when using var, I changed it in all the tests in jsonTests.cs
.
Now it is consistent. What do you think?
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.
Looks good!
As the implementation is (almost) based upon the same approach as StackExchange.Redis
, where the *Commands
inherits from *CommandsAsync
, I do not have a strong opinion on using one or the other as long as the method matches the scenario 👍
One could also use the extension methods to get the same result, i.e., db.JSON()
.
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.
LGTM 👍
No description provided.