Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Unit testing initialization code
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="tron_thomas" data-source="post: 1390409" data-attributes="member: 213172"><p>I am trying to write an appliction for the iPad using Xcode 4.3 and a 3rd party game engine. I also want to write unit test for the components in my application.</p><p></p><p>Currently I'm trying to write a unit test for an object performs some operations during initialization of the application. Basically the object will obtain an instance of another object (provided via a mock in the unit test) and does something with that other object.</p><p></p><p>The problem right now is that the code exists in the initialization phase of the application. This means that before the unit test can actually run the application itself gets launched and tries to initialize itself. The object under test tried to obtain the other object it needs. This fails because the functionality has been written yet (I'm still trying to write the tests for it) and the application dies before the test can run.</p><p></p><p>The whole fact that the application even tries to run during the unit test seems totally screwy from the way unit testing is actually done.</p><p></p><p>How is someone supposed to unit test code like this?</p></blockquote><p></p>
[QUOTE="tron_thomas, post: 1390409, member: 213172"] I am trying to write an appliction for the iPad using Xcode 4.3 and a 3rd party game engine. I also want to write unit test for the components in my application. Currently I'm trying to write a unit test for an object performs some operations during initialization of the application. Basically the object will obtain an instance of another object (provided via a mock in the unit test) and does something with that other object. The problem right now is that the code exists in the initialization phase of the application. This means that before the unit test can actually run the application itself gets launched and tries to initialize itself. The object under test tried to obtain the other object it needs. This fails because the functionality has been written yet (I'm still trying to write the tests for it) and the application dies before the test can run. The whole fact that the application even tries to run during the unit test seems totally screwy from the way unit testing is actually done. How is someone supposed to unit test code like this? [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Unit testing initialization code
Top