metova / MetovaTestKit

A collection of useful test helpers designed to ease the burden of writing tests for iOS applications.
MIT License
23 stars 2 forks source link

Feature/testable cells #40

Closed nhgrif closed 5 years ago

nhgrif commented 5 years ago

This PR adds two convenience methods for testing reusable cells in table/collection views.

The methods will first fail (and not execute the test closure) if the dataSource property is not set.

Next, it will possibly fail if the passed indexPath is outside the bounds for the data source.

Finally, it will possibly fail if the cell returned for the indexPath can't be cast to the specified type.

If any of these fail, the test closure isn't executed and the testCell causes the test to fail. If they all pass, the test closure is executed.