Skip to content
Ben Weese logo: BW inside an orange gear

Ben Weese

  • Blog
  • About
  • Resume
  • Contact

How to unit test? part 2 of 2

Written by

Ben Weese

in

Archived, Uncategorized
Image no longer available
So I have spent the last 3 weeks spending about 3 hours on Friday’s learning what I can about unit test. Obviously I am no expert and I am still learning. The site that has helped me most is NSHipster since I need to learn Xcode based programming with Objective C. The 2 links I have been going over are Unit Testing and XCTestCase.

So with all unit test you will want to run a set up and tear down that will run before each test. This sets up the data you are using to test. You will want to also create a mock database as you are testing the code and not your integration with the database. Then for each unit test you will use the set up and implement a function of the code you are willing to test. Then you will use an assert to check that it is correct by comparing the data output with the correct answer and if it fails you will put out a specific error with the code. This helps you pin point exactly where it is failing. There are all different types of unit test so make sure you are using the correct asserts. To learn more about unit test you can go to the 2 links I provided and you can also go to Udemy and find a course on unit testing.

Image no longer available
←What is Unit Testing? Part 1 of 2
When to write a Test Plan→

More posts

  • Adding Playwright Agents: Lessons from the Deep Trenches

    May 11, 2026
  • Testing with Postman | A Complete Guide to Automation

    November 2, 2022
  • Testing With Postman: Newman for CI/CD Pipeline

    October 26, 2022
  • Testing With Postman: Checking Schema

    October 19, 2022

© Ben Weese · Lincoln, NE

  • Blog
  • Archive
  • LinkedIn
  • RSS