-
Notifications
You must be signed in to change notification settings - Fork 15
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
Mock tests setup #250
base: next-bidirectional
Are you sure you want to change the base?
Mock tests setup #250
Conversation
1d97061
to
87683e9
Compare
@@ -28,6 +28,7 @@ list(APPEND SOURCES | |||
Transport/Transport.cpp | |||
Accessor/Accessor.cpp | |||
Async/Async.cpp | |||
Properties/Properties.cpp |
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.
not needed, all methods in Propierties class are static and should remain static. Tests should verify code as it is
@@ -57,6 +57,11 @@ namespace FireboltSDK | |||
|
|||
void TransportUpdated(Transport<WPEFramework::Core::JSON::IElement>* transport); | |||
|
|||
void UpdateGateway(std::unique_ptr<GatewayImpl> mockGateway) |
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.
as it is only for tests, should be at least under #ifdef ... #endif block, not exposed for any other application using the API.
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.
Several things:
- Application class MUST NOT inherit from a class created for testing purposes. You should make tests for sources as they are without adopting them to your needs
- Keep existing formatting as it is, it makes comparison easier, I am referring to
- Moving brackets to new lines
- Changing argument convention from
type& arg
totype &arg
, I am not arguing here which convention is better, just it is out of the scope of this task
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 agree for the formatting changes, I think my editors autoformator might have made that. I will try to revert it
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.
That class cannot be a part of the application, it has been create for fulfill test scenarios, so its place is in test/ in SDK.
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.
That class cannot be a part of the application, it has been create for fulfill test scenarios, so its place is in test/ in SDK.
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.
That class cannot be a part of the application, it has been create for fulfill test scenarios, so its place is in test/ in SDK.
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.
That class cannot be a part of the application, it has been create for fulfill test scenarios, so its place is in test/ in SDK.
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.
Please, do not modify existing sources to fulfil test requirements.
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.
Please, do not modify existing sources to make tests working.
Also, the same as for Gateway, application class MUST NOT inherit from mock classes created just for testing purposes.
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.
If Properties class won't be changes to make tests, that change would be not needed.
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.
Overall, mock classes for testing purposes cannot exist at application level AND application classes cannot inherit from them.
No description provided.