Skip to content

IGraphClient class is not Mockable #65

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

Open
devanshgoenka97 opened this issue Aug 22, 2019 · 12 comments
Open

IGraphClient class is not Mockable #65

devanshgoenka97 opened this issue Aug 22, 2019 · 12 comments

Comments

@devanshgoenka97
Copy link

The GraphResult class is not available publicly and hence IGraphClient is not Mockable, thus disabling the case to create Unit Tests for the same

@BenjaBobs
Copy link
Collaborator

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.

@amigup
Copy link

amigup commented Aug 23, 2019

@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.

@BenjaBobs
Copy link
Collaborator

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?

@devanshgoenka97
Copy link
Author

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?

@BenjaBobs
Copy link
Collaborator

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?

@devanshgoenka97
Copy link
Author

Yes, @amigup and myself have experience with Azure Pipleline, and CI/CD in general

@BenjaBobs
Copy link
Collaborator

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.

@devanshgoenka97
Copy link
Author

You can setup a new Organization and start a new Project here

@BenjaBobs
Copy link
Collaborator

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?

@evo-terren
Copy link
Owner

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).

@BenjaBobs
Copy link
Collaborator

Unfortunately, my company is also not very invested in this right now.

@amigup
Copy link

amigup commented Aug 30, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants