SyntaxHelpers does not exist in the namespace NUnit.Framework- nUnit (2.2)

"javier fernandez" <[email protected]> Mon, 8 Sep 2008 18:57:52 -0400
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
--===============1473589887==
Content-Type: multipart/alternative; 
	boundary="----=_Part_1587_18767734.1220914672979"

------=_Part_1587_18767734.1220914672979
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
nunit.framework, Version=2.2.0.0, Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77

nunit.mocks, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
nunit.util, Version=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;

     }
}

------=_Part_1587_18767734.1220914672979
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">Hello,<br><br>&nbsp;&nbsp; Its my first time using nUnit as well as compiling&nbsp; C# with mono ( 1.9 ). I installed the &quot;mono-nunit-1.9.1-2.novell.i586.rpm&quot;, and copied an example from a book to a 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&#39; does not exist in the namespace `NUnit.Framework&#39;. Are you missing an assembly reference?<br>
</pre>
Also if I commented out the &quot;using NUnit.Framework.SyntaxHelpers;&quot; it complains that &quot;Assert.That()&quot; doesn&#39;t exists in the namespace NUnit.Framework<br><br>Please advice a solution.<br><br>Thanks in advance.<br>
<pre><br>####################<br>Here&#39;s what&#39;s in my GAC:<br><br>gacutil -l <br><br>nunit.core, Version=<a href="http://2.2.0.0/" target="_blank">2.2.0.0</a>, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77<br>nunit.framework, Version=<a href="http://2.2.0.0/" target="_blank">2.2.0.0</a>, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77<br>
<br>nunit.mocks, Version=<a href="http://2.2.8.0/" target="_blank">2.2.8.0</a>, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77<br>nunit.util, Version=<a href="http://2.2.0.0/" target="_blank">2.2.0.0</a>, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77<br>
<br><br><br>######################<br>Here&#39;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 = Int32.MaxValue;<br><br><br>        for( index = 0; index &lt; list.Length - 1; index++ )<br>        {<br>            if( list[index] &gt; max )<br>
            {<br>                max = list[index];<br>            }<br>        }<br><br>        return max;<br><br>     }<br>}<br></pre><br>&nbsp;&nbsp;&nbsp; <br></div>

------=_Part_1587_18767734.1220914672979--


--===============1473589887==
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=/
--===============1473589887==
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

--===============1473589887==--