nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #02224
[Bug 897289] Re: Is.Empty constraint has unclear failure message
** Changed in: nunitv2
Status: New => Triaged
** Changed in: nunitv2
Importance: Undecided => Low
--
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/897289
Title:
Is.Empty constraint has unclear failure message
Status in NUnit V2 Test Framework:
Triaged
Bug description:
Using v2.6 b2.
var emptyEnumerable = GetEmptyIEnumerable();
var emptyString = GetEmptyString();
Assert.That(emptyEnumerable, Is.Empty);
Assert.That(emptyString, Is.Empty);
If the methods under test in the above example return 'null' instead
of the expected string or IEnumerable, the failure message states
"System.ArgumentException: The actual value must be an IEnumerable".
At least the test is failing correctly, so the problem's not too bad,
but it can be slightly non-intuitive to fix the test, especially when
the actual value being tested is a string.
I'd expect it either to say "The actual value must be an IEnumerable
or a string", or it to give a more precise answer, something like "The
actual value was not empty" / "not empty but null".
To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/897289/+subscriptions
References