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 tests for the presenter of elwin interface #37210
Conversation
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've only had a very quick look, and it looks great! The only think I would say is that it would be better for the MockElwinModel
to inherit from an interface class rather than the ElwinModel
. Was there a reason you did it this way?
Thanks for taking a look. Initialize I implemented the interface on the |
I think it probably would be best practise to use an interface class. That way it would be more consistent with how things are done for the presenters and views |
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 great! Adds a test for the Elwin presenter, and mocks out all dependencies for the presenter to make sure we are only testing the presenter - great job!
Description of work
This PR follows after refactoring the presenter of the elwin interface and making it non qt-dependent (#36537). Now test are added for most public members of the class.
To make it possible to test by mocking the models and the data model, I had to add a new overloaded constructor to the elwin presenter which is only called from the test. All Data Manipulation presenter classes share the same structure, so maybe we can think of adding an issue in the future for homogenizing the presenters and constructing them by passing directly unique pointers to the model, as it is done on most other presenter of mantid MVP interfaces.
Summary of work
Fixes #34928
Further detail of work
To test:
** does not need release notes**
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.