[MonoDevelop] Anyone have problems on OS X with unit testing?

Jay DeBoer jaydeboer at gmail.com
Tue Jul 13 21:34:52 EDT 2010


Hi all,

I am new to MonoDevelop and nunit as well.  I have tried to add a new project to my solution for unit testing.  I have added a reference to nunit and the project file that I want to write the tests for.  I have written a few tests but every time I open the Unit Tests pad it tries to load the tests and then eventually adds (Load Failed) behind the name of the Unit test solution in that view.   I am also new on OS X so I feel pretty lost.  Any thoughts would be greatly appreciated.

Thanks,

Jay

** Example Code from one file **
using System;
using NUnit.Framework;
using CardLib;

namespace CardLibUnitTests
{
	[TestFixture]
	public class CardTests
	{
		public CardTests ()
		{
		}
		
		[Test]
		public void Card_ConstructorTest()
		{
			Card c = new Card(Suits.Diamonds,CardTypes.King, 12);
			Assert.AreEqual(Suits.Diamonds, c.Suit,"Suit does not match.");
			Assert.AreEqual(CardTypes.King, c.CardType, "CardType does not match.");
			Assert.AreEqual(12,c.Rank, "Rank does not match.");
			Assert.IsFalse(c.IsTrump, "Card should default not not trump.");
			Assert.AreEqual((int)Suits.Diamonds * 10000 + c.Rank, c.Priority, "Priority does not match.");
		}
		//CardConstructorTest
		
		[Test]
		public void Card_IsTrumpTrueTest()
		{
			Card c = new Card(Suits.Diamonds,CardTypes.King, 12);
			Card.TrumpSuit = Suits.Diamonds;
			Assert.IsTrue(c.IsTrump, "This care should be trump.");
			Assert.AreEqual((int)Suits.Diamonds * 10000 + 1000 + 12, c.Priority);
		}
		//Card_IsTrumpTrueTest
		
		[Test]
		public void Card_IsTrumpFalseTest()
		{
			Card c = new Card(Suits.Diamonds,CardTypes.King, 12);
			Card.TrumpSuit = Suits.Clubs;
			Assert.IsFalse(c.IsTrump, "This care should not be trump.");
			Assert.AreEqual((int)Suits.Diamonds * 10000  + 12, c.Priority);
		}
		//Card_IsTrumpTrueTest
		
	}
	//CardTests
}


More information about the Monodevelop-list mailing list