Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Unit test runner for iOS

Tags:

Has anyone written (or know about) a .net unit-test runner, preference to NUnit, that runs on iOS ? or do I have to roll my own ?

My goal is to execute the unit tests on the simulator or devices. So far I've seen quite a few posts / blogs on mocking monotouch.dll (but running the tests on a PC) and one answer stating the lack of such tool.

like image 306
poupou Avatar asked Aug 15 '11 12:08

poupou


People also ask

What is XCTest in iOS?

Overview. Use the XCTest framework to write unit tests for your Xcode projects that integrate seamlessly with Xcode's testing workflow. Tests assert that certain conditions are satisfied during code execution, and record test failures (with optional messages) if those conditions aren't satisfied.

How do I test my iOS UI?

Recording a UI Test From the debug bar, click the Record UI Test button. Xcode will launch the app and run it. You can interact with the element on-screen and perform a sequence of interactions for any UI test. Whenever you interact with an element, Xcode writes the corresponding code for it into your method.

What should I unit test iOS?

A unit test is a function you write that tests something about your app. A good unit test is small. It tests just one thing in isolation. For example, if your app adds up the total amount of time your user spent doing something, you might write a test to check if this total is correct.

How do I run unit test in Xcode?

Adding a unit test in Xcode Go to File > New > Target. Select iOS Unit Testing Bundle and then click Next. When you create a new Unit Test target for your project, it consists of a template class.


1 Answers

As promised here's my own solution for my problem :-) I hope it can help other people too!

EDIT

Sounds like you'd have to write a MonoDevelop add-in that serves up an API for remote NUnit runners to send data to. Not really a trivial task.

The original Touch.Unit was updated to include support for network logging (albeit not inside MonoDevelop).

EDIT #2 : A similar runner now exists for Mono for Android.

FINAL EDIT: Touch.Unit is now an integreal part of MonoTouch releases (starting with version 5.2) and does not have to be downloaded seperately.

like image 136
poupou Avatar answered Oct 15 '22 18:10

poupou