Skip to content

This repo shows how to use Quick and Nimble frameworks in iOS apps to improve unit tests readability. A `Car` object is tested using both frameworks and results are compared

Notifications You must be signed in to change notification settings

raphacmartin/CarColdStart-QuickNimble

Repository files navigation

Improving tests readability with Quick and Nimble

How to improve failing message in XCTest

All the XCTFramework methods accepts a last parameter that is a custom message xct_improvement.png

How to improve it using Quick

The code itself is self explanatory, not needing additional arguments xct_vs_quick.png

Test names

Structuring it hierarchically using Quick quick_hierarchy.png

Examples in this Repo

In the Quick/Nimble tests file and in the XCTest tests file, you can find implementations of unit tests that validate a Car object, testing the following scenarios:

  1. Pressing the start button, if the shift is in the P position and the brake pedal is being pressed the car should start the engine
  2. Pressing the start button, if the shift is not in the P position the car should not start the engine
  3. Pressing the start button, if the shift is not in the P position and the brake pedal is not being pressed the car should not start the engine
  4. Fueling the car, With specific gas price Should fill the correct quantity

About

This repo shows how to use Quick and Nimble frameworks in iOS apps to improve unit tests readability. A `Car` object is tested using both frameworks and results are compared

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published