[MonoDevelop] Anyone have problems on OS X with unit testing?
Abe Gillespie
abe.gillespie at gmail.com
Tue Jul 13 22:50:14 EDT 2010
Are you using the Mono-packaged NUnit assemblies? I used ones
downloaded from the NUnit site and experienced some seriously funky
issues such as simply renaming the test would make it go from passing
to failing.
On Tue, Jul 13, 2010 at 9:34 PM, Jay DeBoer <jaydeboer at gmail.com> wrote:
>
> 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
> }
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
More information about the Monodevelop-list
mailing list