Pattern: Empty XCTest method
Issue: -
Empty XCTest method should be avoided.
Examples of correct code:
class TotoTests: XCTestCase {
var foobar: Foobar?
override func setUp() {
super.setUp()
foobar = Foobar()
}
override func tearDown() {
foobar = nil
super.tearDown()
}
func testFoo() {
XCTAssertTrue(foobar?.foo)
}
func testBar() {
// comment...
XCTAssertFalse(foobar?.bar)
// comment...
}
}
Examples of incorrect code:
class TotoTests: XCTestCase {
override ↓func setUp() {
}
override ↓func tearDown() {
}
↓func testFoo() {
}
↓func testBar() {
}
func helperFunction() {
}
}