← Back to team overview

nunit-core team mailing list archive

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

 

Ah. That makes it less serious than I feared. In our tests, ToString is
normally only called on a constraint that has been resolved... I'll see
if your suggestion works. If not, I'll put some indication in the output
that it's an unresolved constraint. We definitely don't want ToString()
to resolve the constraint as a side effect.


** Changed in: nunitv2
   Importance: Undecided => Critical

** Changed in: nunitv2
       Status: New => Triaged

** Changed in: nunitv2
     Assignee: (unassigned) => Charlie Poole (charlie.poole)

** Changed in: nunitv2
    Milestone: None => 2.5.6

-- 
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 V2 Test Framework: Triaged

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