TDD on a existing code base or right from the beginning of your project means also checking for all your IBOutlets to be connected in your view controllers. If you have a bunch of outlets, generating the test methods is a somewhat boring task.
The files attached are automator actions. Just copy it to your ~/Library/Services folder and it will be available in Xcode as a service.
They all work the same way. Select a single word or a bunch of property definition lines. Right click and select the service you need. If you select a line the automator action automatically skips all lines where a certain key (e.g. UIButton, UIBarButton) couldn’t be found. The generated test are copied to the clipboard.
You can easily generate new services by editing the apple script included in the automator action. Follow the guidelines at the beginning of each script and you save a lot of time.
The included test are good for
The property has a delegate which must be connect to the system under test
The property is a UIBarButtonItem with an action connected. Note that you have to fill in the action method!
The property is an IBOutlet which should be connected
The property is a UIButton with an action connected. Note that you have to fill in the action method!
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.