← Back to team overview

nunit-core team mailing list archive

[Bug 605432] Re: ToString not working properly for some properties

 

After giving it some thought, I fixed this by having ToString() produce
output that clearly indicates the constraint is unresolved. So, for
example, Console.WriteLine( Is.Not.All.EqualTo(5).ToString() ) produces
<unresolved <equal 5>>

While not giving all the info, this clearly warns the person using
ToString() that something is amiss.

The repeatability issue, which is related to this problem, will be fixed
separately.

** Also affects: nunit-3.0
   Importance: Undecided
       Status: New

** Changed in: nunit-3.0
       Status: New => Triaged

** Changed in: nunit-3.0
   Importance: Undecided => High

** Changed in: nunitv2
       Status: Triaged => Fix Committed

-- 
ToString not working properly for some properties
https://bugs.launchpad.net/bugs/605432
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.

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

Bug description:
The following code:

            Console.WriteLine(Has.Property("foo").EqualTo("bar"));
            Console.WriteLine(Has.Property("foo").EqualTo("bar").And.Property("baz").EqualTo("qux"));
            Console.WriteLine(Has.Property("foo").EqualTo("bar") & Has.Property("baz").EqualTo("qux"));

prints the following

<equal "bar">
<equal "qux">
<and <property foo <equal "bar">> <property baz <equal "qux">>>

Only the last one is correct.





References