-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix start and end date functionality and add tests #41
Conversation
@AballahNsour Thank you for taking a look at the issue! Feel free to create a PR and tag us if you have any questions. Always great to see contributions from outside contributors and we are happy to support you in the process! |
forgive me I went though the rules again it happens that i have vaiolated one of contribution rules i Will revert on the changes and I will start over. |
No worries; it is always a challenge to get started. Let us know how we can be helpful, we always appreciate contributions and improvements 🚀 |
@PSchmiedmayer hello, I did the best i could with adding the two test cases. |
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.
@AballahNsour thank you for working on the PR and adding some additional tests to this package; greatly appreciated!
This PR is a good step in the right direction; we are still missing some context from #21 that would allow us to close the issue.
- We successfully test that a task that has an end date works. I would suggest that we schedule a tasks that hast at least two scheduled times between the start and end date.
- We need to test the
events(from,to)
function in a separate unit test (to fully address Test Start and End Dates #21). This should include at task that has a fixed end date and one that might have a number of events and we should then retrieve taks up to the end date (and expect all the them to get back) and requests tasks up to an end data that should only return parts of the tasks.
A general suggestion for writing the tests: I would avoid using .now
(or Date()
) for dates. We had some issues with this here and in other packages. I would rather load dates based on fixed date and time combinations and use that for reasoning in the tests. Makes testing and communicating about the tests + asserting correct responses way easier.
Please also try to address all SwiftLint errors that might currently be raised as part of your changes. Thanks again for contributing to our open-source project!
XCTAssertEqual(scheduledEventHash, completedEventHash) | ||
} | ||
func testTaskSchedulingWithStartDateAndEndDate() async throws { |
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 add empty lines between different functions:
func testTaskSchedulingWithStartDateAndEndDate() async throws { | |
func testTaskSchedulingWithStartDateAndEndDate() async throws { |
XCTAssertEqual(scheduledEventHash, completedEventHash) | ||
} | ||
func testTaskSchedulingWithStartDateAndEndDate() async throws { |
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.
Thanks for adding this test!
XCTAssertEqual(scheduledEventHash, completedEventHash) | ||
} | ||
func testTaskSchedulingWithStartDateAndEndDate() async throws { | ||
let startDate = Date().addingTimeInterval(3_000) |
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.
A general suggestion for writing the tests: I would avoid using .now
(or Date()
) for dates. We had some issues with this here and in other packages. I would rather load dates based on fixed date and time combinations and use that for reasoning in the tests. Makes testing and communicating about the tests + asserting correct responses way easier.
This PR was superseeded by #44 |
Name of the PR
♻️ Current situation & Problem
Link any open issues or pull requests (PRs) related to this PR. Please ensure that all non-trivial PRs are first tracked and discussed in an existing GitHub issue or discussion.
⚙️ Release Notes
Add a bullet point list summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.
Include code snippets that provide examples of the feature implemented or links to the documentation if it appends or changes the public interface.
📚 Documentation
Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.
✅ Testing
Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.
📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: