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

Create unit tests for Calculator plugin #6356

Merged
merged 3 commits into from
Sep 10, 2020
Merged

Create unit tests for Calculator plugin #6356

merged 3 commits into from
Sep 10, 2020

Conversation

P-Storm
Copy link
Contributor

@P-Storm P-Storm commented Sep 4, 2020

Summary of the Pull Request

Currently the calculator plugin for PowerToys Run had no unit test (see #5948). With this in place we can test the calculation engine separate. Currently I have also included the problems of #3488 and #3697

PR Checklist

  • Applies to Create unit tests for Calculator plugin #5948
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place:

Info on Pull Request

I have made a start with the unit test. I had to change to structure of the parsing to a separate class. The culture is needed to mimmick the current output and for the unittest to be system agnostic.

Note:
Unit test ParseValuesKnownIssues has known bug unit tested. These are the limitations of teh

Validation Steps Performed

Startup the unit test project Microsoft.Plugin.Calculator.UnitTest in src\modules\launcher\Plugins\Microsoft.Plugin.Calculator.UnitTest\Microsoft.Plugin.Calculator.UnitTest.csproj

Please note that this is the first time contributing for PowerToys. If there is something missing, please let me know 👍

@P-Storm P-Storm changed the title Refactored logic and made it unit testable Create unit tests for Calculator plugin Sep 4, 2020
@P-Storm
Copy link
Contributor Author

P-Storm commented Sep 4, 2020

Labels needed to cover this :

  • Area-Tests
  • Product-Launcher
  • Run-Plugin

It can be reviewed by the core team

@P-Storm P-Storm marked this pull request as ready for review September 4, 2020 08:45
@crutkas crutkas requested a review from a team September 4, 2020 20:38
@crutkas crutkas added Area-Tests issues that relate to tests Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface labels Sep 4, 2020
@ryanbodrug-microsoft
Copy link
Contributor

@P-Storm On first glance this looks fantastic! Thanks for this PR 👍 . I'll take a deeper look this morning

Copy link
Contributor

@ryanbodrug-microsoft ryanbodrug-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a terrific PR, much appreciated. Other than the one nit comment. The only thing I'd ask is that you add the Microsoft.Plugin.Caclulator.UnitTest project to run in CI by adding it to the .net core tests specified here. This will allow us to validate that these tests run for everyone and prevent future breaking changes.

@P-Storm
Copy link
Contributor Author

P-Storm commented Sep 9, 2020

I guess all the feedback is processed. If there is some questions about the new class BracketHelper then I'm glad to clarify or to refine it.

Copy link
Contributor

@ryanbodrug-microsoft ryanbodrug-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the Robustness on the BracketHelper class 👍 Also I can see that the tests are passing in CI now 💯

@crutkas crutkas merged commit 3137aaa into microsoft:master Sep 10, 2020
@P-Storm P-Storm deleted the calculator-unittest branch September 10, 2020 13:51
@P-Storm P-Storm restored the calculator-unittest branch September 12, 2020 22:37
@P-Storm P-Storm deleted the calculator-unittest branch September 13, 2020 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tests issues that relate to tests Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants