using NUnit CollectionAsserts, what assembly do I reference?

7 views
Skip to first unread message

Chuck Sphar

unread,
Apr 1, 2012, 6:47:57 PM4/1/12
to NUnit-Discuss
The compiler isn't buying my attempt to use
CollectionAssert.something. I'm assuming I must be missing a reference
but can't figure out to what.

Here's a test:

using System.Collections.Generic;
using NUnit.Framework;

namespace FDX.PigLatin.Test {

[TestFixture]
public class TranslatorTests: AssertHelper {

[Test]
public void Translator_ProcessRawTokens() {
Translator trans = new Translator( new Tokenizer() );
List<string> rawTokens = trans.GetTokens( );
List<string> cleanTokens = trans.ProcessRawTokens(rawTokens);

CollectionAssert.AreEqual() //
I'm stymied before I can fill out the rest.
}
}
}

Charlie Poole

unread,
Apr 1, 2012, 7:36:28 PM4/1/12
to nunit-...@googlegroups.com
Hi Chuck,

I'm not sure what the problem is... CollectionAssert is part of the
nunit.framework assembly, which you must be referencing if you are
able to use TestAttribute and TestFixtureAttribute.

The code you show is not going to compile, because there are no
arguments to CollectionAssert.AreEqual(). If you were to write
CollectionAssert.AreEqual(rawTokens, cleanTokens) then that would
compile - although it may not be the comparison you wanted to make.

But perhaps I'm not understanding what the problem is.

Charlie

> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
>

Reply all
Reply to author
Forward
0 new messages