Skip to content

Demonstrates how to create unit tests of network code by plugging into Foundation's URL Loading System

License

Notifications You must be signed in to change notification settings

adib/NetworkUnitTestDemo

Repository files navigation

NetworkUnitTestDemo

Purpose

Demonstrates how to create unit tests of network client code. The test revolves around a subclass of URLProtocol which plugs into Foundation’s URL Loading System to mock backend responses.

Refer to this project's article How to Unit Test Network Code in Swift for details.

Usage

Open the project using Xcode then run the ExampleNetworkClientTests unit test suite.

Compatibility

  • Xcode 11.5
  • Swift 5
  • macOS 10.15.5
  • iOS Simulator 13.5

Author

Copyright © Sasmito Adibowo
https://cutecoder.org

License

Apache 2.0 license. See file LICENSE.txt for more information.

About

Demonstrates how to create unit tests of network code by plugging into Foundation's URL Loading System

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages