Mocking the network
You want to test a network layer that uses URLSession directly, with no real server. Can you give me at least two ways to do it?
You want to test a network layer that uses URLSession directly, with no real server. Can you give me at least two ways to do it?
You can abstract the session behind a protocol and inject a stub, or register a URLProtocol subclass on URLSessionConfiguration to intercept the real URLSession path.
TestingMultiple choiceAdvanced
To test the network layer you've decided to intercept responses with a URLProtocol…
#urlsession #urlprotocol
ArchitectureMultiple choiceBasics
In a codebase where a singleton like AnalyticsManager.shared is referenced directly all…
#mock #dependency-injection
CS fundamentals and algorithmsShort answerIntro
What's the difference between TCP and UDP? When a packet is lost, what happens under each…
#urlsession #network
TestingShort answerBasics
What is a test double?
#mock