-
Notifications
You must be signed in to change notification settings - Fork 125
Add unit tests for NWWaitingHandler
#589
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
Labels
good first issue
Good for newcomers
Comments
Hi, @dnadoba. I'd like to address this issue.
Have this been resolved already? If so, I'd like to work on this issue next week. |
Yes, the initialisers are now public and you can address the issue. PRs welcome :) |
natikgadzhi
added a commit
to natikgadzhi/async-http-client
that referenced
this issue
Aug 3, 2023
Motivation: Closes swift-server#589. Since we already have a public initializer for NIOTSNetworkEvents.WaitingForConnectivity, we should add unit tests for the handler now that it's straightforward. Modifications: The tests are in their own file `Tests/NWWaitingHandlerTests.swift`.
dnadoba
added a commit
that referenced
this issue
Aug 14, 2023
* Add unit tests for NWWaitingHandler Motivation: Closes #589. Since we already have a public initializer for NIOTSNetworkEvents.WaitingForConnectivity, we should add unit tests for the handler now that it's straightforward. Modifications: The tests are in their own file `Tests/NWWaitingHandlerTests.swift`. * Bump swift-nio-transport-services to 1.13.0 * [email protected] * Apply suggestions from code review Co-authored-by: David Nadoba <[email protected]> --------- Co-authored-by: David Nadoba <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When we added
NWWaitingHandler
in #588 we didn’t add a unit test for theNWWaitingHandler
. This is because we need to make an enhancement toNIOTransportServices
to make theWaitingForConnectivity
event initialiser public. This is tracked as a separate issue in apple/swift-nio-transport-services#147 and must be resolved first.The unit test can be implemented by using an
EmbeddedChannel
and sending anNIOTSNetworkEvents.WaitingForConnectivity
throughfireUserInboundEventTriggered(_:)
. An example usage ofEmbeddedChannel
andfireUserInboundEventTriggered(_:)
can be found here:async-http-client/Tests/AsyncHTTPClientTests/TLSEventsHandlerTests.swift
Lines 24 to 32 in 3fcd670
This should be straight forward and a good first starter issue. If you have more questions please don't hesitate to ask here.
The text was updated successfully, but these errors were encountered: