Seed data for your unit tests

As I added new scenes and wrote new unit tests for Clean Swift Xcode templates v2, creating test data manually becomes very tedious. There’s got to be a better way. In the Rails-land, seed data for testing purpose is built right in to the framework. You can create all your test fixtures as YAML files […]

Continue reading →

Clean Swift TDD Part 3 – Worker

In part 1 and part 2, you tested the ListOrdersViewController and ListOrdersInteractor, respectively. But we left it kind of hanging because we mocked out the OrdersWorker. In this post, you’ll test the OrdersWorker to make sure it returns the correct orders. But first, let’s abstract away the actual details of fetching orders from a data […]

Continue reading →

Clean Swift TDD Part 2 – Interactor

In my TDD part 1 post, you wrote a test to make sure ListOrdersViewController invoke the fetchOrders() method of the ListOrdersInteractor. Now, it’s time to make the interactor does something with the request. You’ll also see exactly how to delegate the business logic of fetching orders from the interactor to the worker. Prepare the OrdersWorker […]

Continue reading →