← Back to team overview

nunit-core team mailing list archive

[Bug 897289] Re: Is.Empty constraint has unclear failure message

 

** Branch linked: lp:nunit-3.0

-- 
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.
https://bugs.launchpad.net/bugs/897289

Title:
  Is.Empty constraint has unclear failure message

Status in NUnit Test Framework:
  Fix Committed
Status in NUnit V2 Test Framework:
  Fix Committed

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/nunit-3.0/+bug/897289/+subscriptions


References