Skip to content
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

Add interfaces to enable unit testing #64

Closed
CodeCasterNL opened this issue May 30, 2021 · 2 comments · Fixed by #65
Closed

Add interfaces to enable unit testing #64

CodeCasterNL opened this issue May 30, 2021 · 2 comments · Fixed by #65
Labels
enhancement New feature or request
Milestone

Comments

@CodeCasterNL
Copy link
Contributor

Hi @pyrocumulus, nice library, I'm using it in an upcoming Windows Service that syncs GoodWe API to PVOutput. Somewhere in that code, I have a class that wraps your PVOutputClient for configuration and DI purposes, and it has a property:

public PVOutputClient ApiClient { get; }

Now I want to test that my code calls your code, without actually calling your code, it being test data and all which I don't want to be sent to PVOutput.

Could you consider interfacing the PVOutputClient and its services, so it can be mocked for unit tests?

@CodeCasterNL CodeCasterNL added the enhancement New feature or request label May 30, 2021
@pyrocumulus
Copy link
Owner

First of all, thank you for the kind words! It's nice to hear you are using it, I always hoped it would be useful to someone someday👍🏻

About your feature request, no problem. I understand that you need it for unit testing, it's how I use it myself as well. Until now I never looked at my library from an outside unit test standpoint.

Thanks for the PR as well, I'll review it the coming days and integrate it 🙂

pyrocumulus added a commit that referenced this issue Jun 1, 2021
@pyrocumulus pyrocumulus linked a pull request Jun 1, 2021 that will close this issue
@pyrocumulus pyrocumulus added this to the 0.9.1 milestone Jun 1, 2021
@pyrocumulus
Copy link
Owner

The changes have been committed to develop. Planning on releasing 0.9.1 tonight.

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

Successfully merging a pull request may close this issue.

2 participants