Try fast search NHibernate

23 June 2009

NUnitEx 1.0.1 was released

A new version of NUnitEx was released today.

There are only some few new features as:

New assertion for nullable types:

int? nullable= null;
nullable.Should().Not.Have.Value();

New assertion for Action<T> (even if in this case I prefer to use directly the NUnit syntax)

(new Action(() => new AClass(null)))
.Should(title).NotThrow<ArgumentNullException>();

New assertion for string

string something = null;
something.Should().Be.NullOrEmpty();
string.Empty.Should().Be.NullOrEmpty();

Note that in many cases you don’t need news assertion because you can chain a class method to an existing assertion as:

string.IsNullOrEmpty(something).Should().Be.True();

Where the new assertion is really needed, to have a more fluently assertion, there is no problem to create a new issue.

Enjoy NUnitEx.

2 comments:

  1. Congrats! I found another time i had to do an assert, may be i was missing something.
    I wanted to check that a boolean is equal to another boolean.

    you have the handy, myBool.Should().Be.True(). But i was expecting to have myBool.Should().Be.EqualTo(myOtherBool)

    Should i add it as a feature request or i'm missing something?

    Gustavo.

    ReplyDelete
  2. If you want add an issue there is no problem.
    Btw you are forgetting
    myBool.Should().Satisfy(b=> b == myOtherBool)

    ReplyDelete