nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #00081
[Bug 400502] Re: NUnitEqualityComparer.StreamsEqual fails for same stream
** Changed in: nunit-3.0/trunk
Status: Fix Committed => Fix Released
--
NUnitEqualityComparer.StreamsEqual fails for same stream
https://bugs.launchpad.net/bugs/400502
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: Fix Released
Status in NUnit Framework trunk series: Fix Released
Bug description:
Bug Reported and fixed in NUnit 2.5 series:
When asserting a stream of non-zero length is equal to itself, NUnit
returns a failure because the comparer assumes it is two separate
references that it can read in parallel.
The following test incorrectly fails with:
NUnit.Framework.AssertionException: Stream lengths are both 3. Streams
differ at offset 0.
[Test]
public void TestStreamsEqual()
{
Stream exampleStream = new MemoryStream(new byte[] {1, 2, 3});
Assert.That(exampleStream, Is.EqualTo(exampleStream));
}
References