CollectionAssert.DoesNotContain does not work in correctly in cssyntax.cs

Bug #527729 reported by ichselber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit V2
Fix Released
Low
Charlie Poole

Bug Description

Maybe i am to new to all this testing and c#. Here the lines of AssertSyntaxTests that do not seem to work correctly

  int[] iarray = new int[] { 1, 2, 3 };
  double onedouble = 1.0d;

// Showing that Contains uses object equality
  Assert.That(iarray, Has.No.Member( 1.0d )); // fails
CollectionAssert.DoesNotContain(iarray, 1.0d); // fails

The Messge is:
"Expected: not collection containing 1.0d But was: < 1, 2, 3 > - C:\Program Files\NUnit 2.5.3\samples\csharp\syntax\AssertSyntaxTests.cs:558,4"

CollectionAssert.Contains(iarray, 1.0d); // does not fail

Possibly its just an implicit type cast, but it does fail the whole tree - or is that intended to happen?

If it is of any interest:
I am currently using VS 2008 Express and SharpDev - both with same results

Related branches

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

There is no file cssyntax.cs that I'm able to find, but on a second look, it appears that this bug relates to the sample file AssertSyntaxTests.cs, which is part of the nunitv2 project - not the nunit-3.0 project. Let me know if that's wrong.

This is a bug in the sample, due to the fact that the implementation of Contains has changed.

With regard to the whole tree failing - that's what NUnit does. Either you pass 100% or you fail!

Charlie

affects: nunit-3.0 → nunitv2
Changed in nunitv2:
status: New → Triaged
importance: Undecided → Low
milestone: none → 2.5.5
Changed in nunitv2:
assignee: nobody → Charlie Poole (charlie.poole)
Revision history for this message
Charlie Poole (charlie.poole) wrote :

Same problem is in the VB sample.

Changed in nunitv2:
status: Triaged → Fix Committed
Changed in nunitv2:
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.