[TestFixture] public class IHateNunit { [Test] public void A_list_works() { IList<string> strs = new List<string>() { "asdf" }; //Double Pass Assert.That(strs.Count, Is.EqualTo(1)); Assert.That(strs, Has.Count(1)); } [Test] public void An_array_doesnt() { IList<string> strs = new string[] { "asdf" }; //Pass Assert.That(strs.Count, Is.EqualTo(1)); //#FAIL Assert.That(strs, Has.Count(1)); } }
I wonder if Has.Length(1) works in the array case?
Why not just use the Unit testing built into Visual Studio 2005 and up? Sorry if wondering that makes me sound clueless.
Also, in Fluent NHibernate, is there a tool for generating the mapping classes? It would be much like MyGeneration does for regular NHibernate mappings and classes.
Thanks!
@Brian O
I have always been an NUnit fan. This was really a problem with reflection and not really NUnit’s fault. It’s just a CLR oddity.
As for Fluent, I really don’t know. I haven’t ever played around with generation so I can’t help. Sorry.
@Nachos
My guess is yes, but I didn’t test it.