How to add helper methods to XCTestCase unit in Xcode?
Only methods that start with test
will be considered tests. So, just name your helper method something that doesn't start with test
.
By the way, I would not be inclined to put XCTAssert
statements in your helper method. It works (the appropriate tests will fail), but in some scenarios it makes it hard to decipher which tests caused the assert in the helper method to fire.