Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
So i just started to learning unit testing in IOS and i have few simple tasks to complete.

So basically i have created a Tab bar controller with only two tabs. How can i test that there indeed only two tabs ?

Also, i have an order: The first tab and the second tab How can i test the order of these tabs following the assertion that "first tab" should be placed first and "second tab" should be placed second ?

I assume that i should start from Tests folder and do something with XCTAssert, but for now i have no clue from what to start.

Could someone tell me how can i approach this?

i haven't found any good tutorials about this
Posted

1 solution

At first testing has changed somehow on Apple systems. ReadAbout Testing with Xcode.

You can assign the Tabbar to an outlet an than access the array of tabs. To start Testing, use on the Menu Product -> Test or Product->Build for Testing. Testing only runs on the simulator. If to feasable, you can use NSAssert in the normal code.
 
Share this answer
 
Comments
Member 11447944 25-Feb-15 15:25pm    
can you tell me how to access the array of the tabs more specifically? I know how to do unit tests, but i have no idea how to access the array of tabs.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900