Re: SyntaxHelpers does not exist in the namespaceNUnit.Framework- nUnit (2.2)

"Charlie Poole" <[email protected]> Mon, 8 Sep 2008 17:02:20 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <018e01c9120f$55929910$6401a8c0@ferrari>
This is a multi-part message in MIME format.

--===============1796563196==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_018F_01C911D4.A933C110"

This is a multi-part message in MIME format.

------=_NextPart_000_018F_01C911D4.A933C110
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

The constraint-based assertion model and syntax was introduced in NUnit 2.4,
so you would
have to be using a later version of NUnit for that to work. Since we don't
provide the RPMs,
I can't help you there. However, it's feasible to take any of our binary
distributions and 
manually copy the assemblies to the correct location on your system,
provided you have
root access. Or if you don't, just copy them into directories relative to
your home directory.
 
The NUnit project will eventually provide packages for an easier Linux
install, but we're
not there yet.
 
Charlie


  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of javier
fernandez
Sent: Monday, September 08, 2008 3:58 PM
To: [email protected]
Subject: [Nunit-users] SyntaxHelpers does not exist in the
namespaceNUnit.Framework- nUnit (2.2)


Hello,

   Its my first time using nUnit as well as compiling  C# with mono ( 1.9 ).
I installed the "mono-nunit-1.9.1-2.novell.i586.rpm", and copied an example
from a book to a file for testing. But compiling the example using gmcs
failed with the following error:

[javier@localhost csharp]$ gmcs -debug -t:library -r:System
-r:nunit.framework.dll -r:nunit.util.dll -out:Largest.dll Largest.cs
LargestTest.cs 
LargestTest.cs(3,23): error CS0234: The type or namespace name
`SyntaxHelpers' does not exist in the namespace `NUnit.Framework'. Are you
missing an assembly reference?

Also if I commented out the "using NUnit.Framework.SyntaxHelpers;" it
complains that "Assert.That()" doesn't exists in the namespace
NUnit.Framework

Please advice a solution.

Thanks in advance.


####################
Here's what's in my GAC:

gacutil -l 

nunit.core, Version=2.2.0.0 <http://2.2.0.0/> , Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77
nunit.framework, Version=2.2.0.0 <http://2.2.0.0/> , Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77



nunit.mocks, Version=2.2.8.0 <http://2.2.8.0/> , Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77
nunit.util, Version=2.2.0.0 <http://2.2.0.0/> , Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77





######################
Here's the source code example

//LargestTest.cs

using System;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

[TestFixture]
public class LargestTest


{
    [Test]
    public void LargestOf3()
    {

        Assert.That( Cmp.Largest( new int[] {8,9,7} ), Is.EqualTo(9) );
    }
}


// Largest.cs

using System;

public class Cmp


{
    public static int Largest( int[] list )
    {
        int index, max = Int32.MaxValue;


        for( index = 0; index < list.Length - 1; index++ )
        {
            if( list[index] > max )


            {
                max = list[index];
            }
        }

        return max;

     }
}

    



------=_NextPart_000_018F_01C911D4.A933C110
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =
size=3D2>The=20
constraint-based assertion model and syntax was introduced in NUnit 2.4, =
so you=20
would</FONT></SPAN></DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =
size=3D2>have=20
to be using a later version of NUnit for that to work. Since we don't =
provide=20
the RPMs,</FONT></SPAN></DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =
size=3D2>I=20
can't help you there. However, it's feasible to take any of our binary=20
distributions and </FONT></SPAN></DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =

size=3D2>manually copy the assemblies to the correct location on your =
system,=20
provided you have</FONT></SPAN></DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =
size=3D2>root=20
access. Or if you don't, just copy them into directories relative to =
your home=20
directory.</FONT></SPAN></DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =
size=3D2>The=20
NUnit project will eventually provide packages for an easier Linux =
install, but=20
we're</FONT></SPAN></DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =
size=3D2>not=20
there yet.</FONT></SPAN></DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D406025923-08092008><FONT face=3DArial color=3D#0000ff =

size=3D2>Charlie</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
  <HR tabIndex=3D-1>
  <FONT face=3DTahoma size=3D2><B>From:</B>=20
  [email protected]=20
  [mailto:[email protected]] <B>On Behalf Of =
</B>javier=20
  fernandez<BR><B>Sent:</B> Monday, September 08, 2008 3:58 =
PM<BR><B>To:</B>=20
  [email protected]<BR><B>Subject:</B> [Nunit-users]=20
  SyntaxHelpers does not exist in the namespaceNUnit.Framework- nUnit=20
  (2.2)<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=3Dltr>Hello,<BR><BR>&nbsp;&nbsp; Its my first time using =
nUnit as well=20
  as compiling&nbsp; C# with mono ( 1.9 ). I installed the=20
  "mono-nunit-1.9.1-2.novell.i586.rpm", and copied an example from a =
book to a=20
  file for testing. But compiling the example using gmcs failed with the =

  following error:<BR><PRE>[javier@localhost csharp]$ gmcs -debug =
-t:library -r:System -r:nunit.framework.dll -r:nunit.util.dll =
-out:Largest.dll Largest.cs LargestTest.cs <BR>LargestTest.cs(3,23): =
error CS0234: The type or namespace name `SyntaxHelpers' does not exist =
in the namespace `NUnit.Framework'. Are you missing an assembly =
reference?<BR>
</PRE>Also if I commented out the "using NUnit.Framework.SyntaxHelpers;" =
it=20
  complains that "Assert.That()" doesn't exists in the namespace=20
  NUnit.Framework<BR><BR>Please advice a solution.<BR><BR>Thanks in =
advance.<BR><PRE><BR>####################<BR>Here's what's in my =
GAC:<BR><BR>gacutil -l <BR><BR>nunit.core, Version=3D<A =
href=3D"http://2.2.0.0/" target=3D_blank>2.2.0.0</A>, Culture=3Dneutral, =
PublicKeyToken=3D96d09a1eb7f44a77<BR>nunit.framework, Version=3D<A =
href=3D"http://2.2.0.0/" target=3D_blank>2.2.0.0</A>, Culture=3Dneutral, =
PublicKeyToken=3D96d09a1eb7f44a77<BR>
<BR>nunit.mocks, Version=3D<A href=3D"http://2.2.8.0/" =
target=3D_blank>2.2.8.0</A>, Culture=3Dneutral, =
PublicKeyToken=3D96d09a1eb7f44a77<BR>nunit.util, Version=3D<A =
href=3D"http://2.2.0.0/" target=3D_blank>2.2.0.0</A>, Culture=3Dneutral, =
PublicKeyToken=3D96d09a1eb7f44a77<BR>
<BR><BR><BR>######################<BR>Here's the source code =
example<BR><BR>//LargestTest.cs<BR><BR>using System;<BR>using =
NUnit.Framework;<BR>using =
NUnit.Framework.SyntaxHelpers;<BR><BR>[TestFixture]<BR>public class =
LargestTest<BR>
{<BR>    [Test]<BR>    public void LargestOf3()<BR>    {<BR><BR>        =
Assert.That( Cmp.Largest( new int[] {8,9,7} ), Is.EqualTo(9) );<BR>    =
}<BR>}<BR><BR><BR>// Largest.cs<BR><BR>using System;<BR><BR>public class =
Cmp<BR>
{<BR>    public static int Largest( int[] list )<BR>    {<BR>        int =
index, max =3D Int32.MaxValue;<BR><BR><BR>        for( index =3D 0; =
index &lt; list.Length - 1; index++ )<BR>        {<BR>            if( =
list[index] &gt; max )<BR>
            {<BR>                max =3D list[index];<BR>            =
}<BR>        }<BR><BR>        return max;<BR><BR>     =
}<BR>}<BR></PRE><BR>&nbsp;&nbsp;&nbsp;=20
  <BR></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_018F_01C911D4.A933C110--




--===============1796563196==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--===============1796563196==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users

--===============1796563196==--