-
Notifications
You must be signed in to change notification settings - Fork 19
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 initial test cases #38
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.
Thank you for your contribution! And I ask you to fix some points:
- Why you back to KeyPath style:
@DependencyClient
will generatetestValue()
. - Dummy data should be under your tests if you use only for testing.
I have fixed the pointed out issues. One point of concern is that I named it 'mock' based on the sample code from TCA, but thinking about it, 'dummy' might be a better choice. What do you think? |
static public let testValue = Self() | ||
|
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.
This is also macro's roll
@@ -38,6 +38,7 @@ public struct Schedule { | |||
case path(StackAction<Path.State, Path.Action>) | |||
case destination(PresentationAction<Destination.Action>) | |||
case view(View) | |||
case fetchResponse(Result<(Conference, Conference, Conference), Error>) |
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.
Might be better with creating struct.
case fetchResponse(Result<(Conference, Conference, Conference), Error>) | |
case fetchResponse(Result<SchedulesResponse, Error>) |
The struct may be like below:
public struct SchedulesResponse: Equatable {
var day1: Conference
var day2: Conference
var workshop: Conference
}
Either is OK in this test. |
Co-authored-by: Daiki Matsudate <[email protected]>
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.
Thank you for adding test! Now we're time to run it on CI!
Thank you for your review! |
Added first tests using TestStore.
Ref: #28