Feature Request: Is.Negative, Is.Positive

Bug #898192 reported by Daniel Hampe
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
NUnit Framework
Fix Released
High
Charlie Poole
NUnit V2
Fix Released
Low
Charlie Poole

Bug Description

Hi there,

it would be really nice, if NUnit would provide two Syntax Helpers for checking whether a number is positive or negative (e.g. to have Is.Positive or Is.Negative). This would improve readability :-)

Regards
Daniel

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Would it satisfy you if we simply added the syntax but used GreaterThan and
LessThan constraints to implement it? The message would then be from
the GreaterThan/LessThan constraint.

Charlie

Revision history for this message
Daniel Hampe (hampe-daniel) wrote :

I see no problem with using the GreaterThan/LessThan constraints.

Regards
Daniel

Changed in nunitv2:
importance: Undecided → Low
milestone: none → 2.6.0
assignee: nobody → Charlie Poole (charlie.poole)
Changed in nunitv2:
status: New → Triaged
Changed in nunitv2:
status: Triaged → Fix Committed
Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Charlie Poole (charlie.poole)
milestone: none → 2.9.6
Changed in nunit-3.0:
status: Triaged → Fix Committed
Changed in nunitv2:
status: Fix Committed → Fix Released
Revision history for this message
Rechenelf (matklaus) wrote :

But Is.NotPositive or Is.NotNegative is than needed too.
Is.NotPositive is short for <= 0, LessEqualThan
and so on

Revision history for this message
Daniel Hampe (hampe-daniel) wrote :

It is implictly avaliable by Is.Not.Positive and Is.Not.Negative :-)

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Exactly so. There are no negative constraints because the design allows any constraint to be negated with Not.

Additionally, while it may be useful to add additional requests or information to bugs in some cases, this bug is already closed, so it's really not useful in this case.

Changed in nunit-3.0:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.