Mocking a Network Request (Unit Testing Part 3)
CodeWithChris CodeWithChris
588K subscribers
14,469 views
0

 Published On Apr 25, 2022

In this lesson, learn how to add a unit test target to an existing project and mock a network request. Mocking the network request isolates your code from external factors, to test your own code, rather than testing others’ code.

This video is presented by Mikaela Caron (   / mikaelacaron  )

Timestamps:
00:00 Intro
00:28 Cloning the Project
05:24 Reviewing the App
07:08 Add Unit Test Target to Existing Project
11:19 Refactor the Singleton
18:42 Create an HTTPClientProtocol
25:40 How to Mock the Network Request

Links:
GitHub: The iOS Vapor Project - https://github.com/codewithchris/YT-V...

🚨 SPECIAL CWC+ OFFER FOR YOUTUBE:
https://cwc.to/youtubeoffer

MY FREE ONLINE COURSE:
⚡ How to make an app in 14 days - https://cwc.to/14days

CWC+ PROGRAM:
👩‍💻 All our courses in a learning path - https://cwc.to/plus

WEEKLY UPDATES VIA EMAIL:
✉️ Every Saturday, receive an email digest of new content - https://cwc.to/newsletter

CONNECT:
🌍 Website - https://codewithchris.com
😺 GitHub - https://github.com/codewithchris
📸 Instagram -   / codewithchris  
🐦 Twitter -   / codewithchris  

ABOUT CODEWITHCHRIS:
Hi I’m Chris! I’m dedicated to teaching fundamentals about how to make an app. This is important if you’re trying to land an iOS job, be a freelancer, increase or start a business with an app idea. On this channel and my website, you'll find a ton of free resources and tutorials to aid you on your journey to learn iOS development. Many people have learned to code and build apps on their own! https://cwc.to/reviews

DID THESE LESSONS HELP YOU?
Please let me know! - https://feedback.codewithchris.com

ROADMAP:
https://roadmap.codewithchris.com

show more

Share/Embed