How to compile NUnit Test files.

D

d2d

How are you doing there folks?

I just have this newbie question about how to compile an NUnit test file
from command line using "csc.exe"

I installed NUnit 2.1 using *.msi file.
I was following examples that came with NUnit and when I tried to
compile Nunit test file here is the error i received:

========================================================================

Directory of G:\programming\c#\ff\test\NUnit

09/07/2003 12:42 PM <DIR> .
09/07/2003 12:42 PM <DIR> ..
09/06/2003 11:56 PM 424 AccountTest.cs
09/06/2003 11:51 PM 425 Bank.cs
09/07/2003 12:42 PM 3,072 Bank.dll

G:\programming\c#\ff\test\NUnit>csc /target:library /lib:Bank.dll
AccountTest.cs

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

AccountTest.cs(3,8): error CS0246: The type or namespace name 'NUnit'
could not be found (are you missing a using directive or an assembly
reference?)
AccountTest.cs(8,4): error CS0246: The type or namespace name 'Test'
could not be found (are you missing a using directive or an assembly
reference?)
AccountTest.cs(5,3): error CS0246: The type or namespace name
'TestFixture' could not be found (are you missing a using directive or
an assembly reference?)

========================================================================

I have no clue how to deal with this.. Went through other forums and
documents but have been unsuccessful on compile that AccountTest.cs file.

I would appreciate your help
Thank you in advance.
 
J

Joshua Coady

How are you doing there folks?

I just have this newbie question about how to compile an NUnit test file
from command line using "csc.exe"

I installed NUnit 2.1 using *.msi file.
I was following examples that came with NUnit and when I tried to
compile Nunit test file here is the error i received:

========================================================================

Directory of G:\programming\c#\ff\test\NUnit

09/07/2003 12:42 PM <DIR> .
09/07/2003 12:42 PM <DIR> ..
09/06/2003 11:56 PM 424 AccountTest.cs
09/06/2003 11:51 PM 425 Bank.cs
09/07/2003 12:42 PM 3,072 Bank.dll

G:\programming\c#\ff\test\NUnit>csc /target:library /lib:Bank.dll
AccountTest.cs

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

I think a fix for that was mentioned in the readme for the particlar examples that ar included with the install (look for the readme in the sample folders).

Josh

AccountTest.cs(3,8): error CS0246: The type or namespace name 'NUnit'
could not be found (are you missing a using directive or an assembly
reference?)
AccountTest.cs(8,4): error CS0246: The type or namespace name 'Test'
could not be found (are you missing a using directive or an assembly
reference?)
AccountTest.cs(5,3): error CS0246: The type or namespace name
'TestFixture' could not be found (are you missing a using directive or
an assembly reference?)

========================================================================

I have no clue how to deal with this.. Went through other forums and
documents but have been unsuccessful on compile that AccountTest.cs file.

I would appreciate your help
Thank you in advance.
 
N

Neno Loje [MSP]

Add the reference to NUnit.Framework.dll when compiling, e.g.

G:\programming\c#\ff\test\NUnit>csc /target:library /lib:Bank.dll
/r:c:\nunit2\nunit.framework.dll
AccountTest.cs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top