Learn how to write more unit tests that work with time and verify logic works as expected around specific dates in time.
Code: https://github.com/PaulSolt/TestingTi...
Lambda School iOS: https://lambdaschool.com/courses/cs/ios/
You'll learn how to write code using a TimeTraveler based on John Sundell's article on unit testing time (Link below).
By following along and writing the code, you can turn this exercise into a Code Kata, which you can practice over again to reinforce the concepts for testing time related code.
The code uses dependency injection to provide a new date generating function, so that we can time travel in your unit tests. Unit testing is a great way to verify the logic works like you expect it to work.
Video Links
Part 1: • Xcode Unit Testing Time Introduction ...
Part 2: • Your First Unit Test in Xcode (XCTest...
Part 3: • Test Driven Development with Unit Tes...
Part 4: • Unit Testing and Dependency Injection...
Source Code
Part 1: https://github.com/PaulSolt/TestingTi...
Part 2: https://github.com/PaulSolt/TestingTi...
Part 3: https://github.com/PaulSolt/TestingTi...
Part 4: https://github.com/PaulSolt/TestingTi...
Watch video Unit Testing and Dependency Injection to Time Travel - Swift TDD Code Kata (4/4) online without registration, duration hours minute second in high quality. This video was added by user Paul Solt 30 January 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,068 once and liked it 16 people.