views:

18

answers:

0

I'm new to both Monotouch and Monodevelop. Trying to get started with NUnit and I'm having a lot of trouble -- none of the sketchy references I can find on line seem to match what I'm seeing in the UI (MonoDevelop 2.4 on Mac OS 10.6). I've tried:

  1. Adding an "NUnit assembly test collection" project to my solution.
  2. Adding an "Empty MonoTouch Project" project to my solution, and then adding the NUnit assemblies to it, and adding my main project as a reference.
  3. Adding a C# "Empty Project" to my solution, and adding NUnit, MonoTouch, and my own project as references. This produces a build error complaining that "'[test project name].exe' does not contain a static 'Main' method suitable for an entry point."

(1) produces a strange sort of project to which I can only add assemblies -- no references and certainly no tests.

(2) and (3) behave pretty much identically:

  • First, a build error complaining that there's no static 'Main' method. I can fix this by changing the compile target to "Library" in the Build -> General project options.
  • Next, when I try to run the tests (from the Unit Testing tab), it says it's running them using the "Debug|iPhoneSimulator" configuration.
  • The Test Results panel shows this "running tests" message, and never any other output.
  • The counts stay at "Tests: 0 Failed: 0 Ignored: 0".

Clearly I'm doing something wrong here, but what am I supposed to be doing?

Just for grins, here's my test.

using System;
using NUnit.Framework;
namespace mynamespace
{ 
    [TestFixture]
    public class NavItemTest
    {
        [Test]
        public void TestAll()
        {
           Assert.AreEqual(4, NavItem.all().Count);
        }
    }
}