Try fast search NHibernate

28 July 2009

NUnitEx 1.0.4 released

NUnitEx 1.0.4 was released today (download).

Charlie Poole, NUnit’s project leader, included NUnitEx as official NUnit AddOnsunder review for possible inclusion in NUnit 3.0” (thanks Charlie) and we are looking for some response from users (the thread is here).

News

Shorten Enumerable Constraints

Some constraints now accept a params T[] so you can write more concise assertion when the expected value is know.

var ints = new[] { 1, 2, 3 };
ints.Should().Have.SameSequenceAs(1, 2, 3);
ints.Should().Have.SameValuesAs(3, 2, 1);
ints.Should().Be.SubsetOf(1, 2, 3, 4);

These new overloads was implemented extending the extensions. ;-)

Count assertion

The Count assertion can be useful in two ways:

To have a “more readable” assertion: ints.Should().Have.Count.EqualTo(3)

As chainable assertion for IEnumerable<T>: ints.Should().Contain(3).And.Not.Have.Count.LessThan(2);

Notes

Thanks to José Romaniello NUnitEx was tested on Mono.

If you have some proposal please don’t hesitate to share it.

10 comments:

  1. Intelliscence can be your friend also in monodevelop.
    Great work Fabio.

    ReplyDelete
  2. Problems:
    1. I The tests failed for this sample:
    MyClass.IsValid().Should().Be.False();
    Exception: System.TypeLoadException : Can't load type "NUnit.Framework.Is" from assembly "nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77".
    2. The code:
    MyClass.IsValid().Should().Not.Be.False();
    does not compiled, error: NUnit.Framework.IBooleanConstarints does not contains definition for "Not"

    ReplyDelete
  3. NUnitEx1.0.4 is working with NUnit2.5

    ReplyDelete
  4. I included the latest NUnit and NUnitEx assemblies in my test project but my GUIRunner (Galio) still throws exception about NUnit 2.4.8.0 If I modified test project without using NUnitEx all works fine.
    Any suggettions?

    ReplyDelete
  5. Remove NUnit from the GAC and/or ensure GALIO is compiled for NUnit2.5.1.
    Btw we can use the http://groups.google.com/group/nunit-discuss

    ReplyDelete
  6. Solved!
    Problem was in incorrect dll binding app.config file in my test project.
    Huch!!!

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete