nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #02223
[Bug 897289] [NEW] Is.Empty constraint has unclear failure message
Public bug reported:
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".
** Affects: nunitv2
Importance: Undecided
Status: New
--
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:
New
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
Follow ups
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2013-10-05
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2012-01-18
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Launchpad Bug Tracker, 2011-12-10
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2011-12-10
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Launchpad Bug Tracker, 2011-12-10
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2011-12-10
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2011-12-06
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2011-12-02
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2011-12-01
-
[Bug 897289] Re: Is.Empty constraint has unclear failure message
From: Charlie Poole, 2011-11-29
-
[Bug 897289] [NEW] Is.Empty constraint has unclear failure message
From: GT, 2011-11-28
References