← Back to team overview

nunit-core team mailing list archive

[Bug 527729] Re: CollectionAssert.DoesNotContain does not work in correctly in cssyntax.cs

 

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

-- 
CollectionAssert.DoesNotContain does not work in correctly in cssyntax.cs
https://bugs.launchpad.net/bugs/527729
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.

Status in NUnit Test Framework: New

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





References