Skip to content
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

Swift: Add mocking example #5260

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Conversation

shepazon
Copy link
Contributor

This example demonstrates how to use a protocol to mock the AWS SDK for Swift, since Swift lacks the readwrite reflection required for traditional mocking. Passes the test (which is also the exemplar).

There is no build available on the web since this example is not one that corresponds to a particular function, but instead a technique for Swift developers using the SDK.

Once this PR is submitted, I'll start writing the AWS SDK for Swift Developer Guide chapter that will embed these snippets as it explains the mocking technique used here.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@shepazon shepazon self-assigned this Aug 14, 2023
@github-actions github-actions bot added the Swift This issue relates to the AWS SDK for Swift label Aug 14, 2023
@shepazon shepazon added On Call Review needed This work needs an on-call review Text Review needed This work needs editorial (text) review labels Aug 14, 2023
@shepazon
Copy link
Contributor Author

Third time's the charm! Ready to review.

@shepazon shepazon removed the Text Review needed This work needs editorial (text) review label Aug 15, 2023
Copy link
Contributor

@ford-at-aws ford-at-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ford-at-aws ford-at-aws added On Call Review complete On call review complete Text Review complete Text review complete and removed On Call Review needed This work needs an on-call review labels Aug 17, 2023
This example demonstrates how to use a protocol to mock the AWS SDK for Swift, since Swift lacks the readwrite reflection required for traditional mocking. Passes the test (which is also the exemplar).

There is no build available on the web since this example is not one that corresponds to a particular function, but instead a technique for Swift developers using the SDK.

Once this PR is submitted, I'll start writing the AWS SDK for Swift Developer Guide chapter that will embed these snippets as it explains the mocking technique used here.
@ford-at-aws ford-at-aws merged commit 6e567b2 into awsdocs:main Aug 21, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Call Review complete On call review complete Swift This issue relates to the AWS SDK for Swift Text Review complete Text review complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants