Domanda

After adding a MonoTouch Unit Tests Project I have to run the tests through the simulator. Since most of my tests don't test the UI, is there a way to run tests through MonoDevelop like the normal nunit project?

È stato utile?

Soluzione

is there a way to run tests through MonoDevelop like the normal nunit project?

Depending on your unit tests you might still continue to use the normal Unit Test projects. They will be executed by the MonoDevelop's test runner which runs under the normal/desktop .NET runtime (e.g. Mono) under the host operating system (e.g. OSX).

So if you have pure C# test code that does not depend on anything iOS specific then this option is always available.

In contrast MonoTouch Unit Tests Project are meant to be executed using the Touch.Unit test runner under iOS (simulator or devices). As such it must be an application since it is not possible (i.e. allowed under iOS) for a general runner (or any other) application to download and execute code (e.g. a library containing your tests).

Other than the runner the projects are basically just a reference to a NUnitLite (0.6) assembly to give you a unit testing framework.

Since most of my tests don't test the UI

Touch.Unit is not meant to run UI tests - just like NUnit (with it's GUI runner) was not meant to unit test System.Windows.Forms applications. The fact that it provides an UI makes it harder to test (some) UI components.

Touch.Unit's main goal is to allow you to run your test under the same conditions (e.g. CPU, memory) and limitations (e.g. AOT) that a real iOS device (or, to a lesser extent, the iOS simulator) would have - while giving you access to every iOS specific API (supported by the device or the simulator).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top