Gremlin.Net.CosmosDb
Gremlin.Net.CosmosDb copied to clipboard
IGraphClient class is not Mockable
The GraphResult
class is not available publicly and hence IGraphClient
is not Mockable, thus disabling the case to create Unit Tests for the same
Meh, the whole thing should really just be interfaced. I don't know why it wasn't in the first place (probably laziness). I don't really have time to work on this, but I guess it's always good to have more tests. I'll review a pr if you would care to interface the thing.
@devanshgoenka97 and @BenjaBobs - The IGraphClient returns the concrete object of GraphResult
(link) so not sure how interfacing the GraphResult
would work here to mock. The GraphResult
constructor should be made public so that it can be mocked by inheriting it to MockClass.
The code's been merged. I do have a question though, why would interfacing it not make it mockable? Both Moq and NSubstitute support creating mocks for interfaces. Since IGraphClient
is an interface, it could be mocked to return a mocked IGraphResult
which can then be setup to do whatever the test needs. Am I missing something?
The issue isn't to mock IGraphClient
. It is more about creating an object of GraphResult
.
Also could you build the project so that I can use the latest version on Nuget?
I have zero experience, and right now I don't have time. I might have time to look at it this weekend. We really should get some ci/cd running. Do any of you have any experience with Azure Pipelines or other similar projects?
Yes, @amigup and myself have experience with Azure Pipleline, and CI/CD in general
Nice! So where does one start with getting that setup? I heard Azure Pipelines is free for open source so that seems like the obvious choice to me.
You can setup a new Organization and start a new Project here
Even though it's free, it still requires me to have my credit card hooked up, which I'm not too fond of since this is not even my repo. @evo-terren Any chance you can set this up?
Sorry, guys. My company has completely pulled out of supporting this project and I also feel wary of throwing my personal credit card in there for a project I likely won't be working on (at least for the foreseeable future).
Unfortunately, my company is also not very invested in this right now.
@BenjaBobs and @evo-terren - If you can grant me access on this repository then I can try creating the build definition using my account. Please grant access to github user - amigup and microsoft live account - [email protected]. Also please grant access on published nuget.org package