Re: "Failed to locate fixture" nunit-console with simpletest case
"Charlie Poole" <[email protected]>
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <003801c84579$c2d30db0$6401a8c0@FERRARI> |
H Josh, I'll tell you how to make your approach work land then suggest some different approaches you may prefer. Running NUnit as the debug program is a good way run your tests within Visual Studio. However, you can't I don't believe that you can use macros like $(TargetPath) as a part of the working directory entry in the Debug properties dialog, the way you can when setting up an external tool. The solution is to hard code the path to your test assembly. To make it easier, I generally set the working directory to the location of the assembly and just put it's name and any options on the command line. Alternatives: 1) Set up an external tool that runs tests on the current project. Note however that some of the macros point to the obj directory - be sure you are running the copy of the test assembly in the bin directory. 2) Run the NUnit gui along with Visual Studio and set it to automatically run the tests each time the assemblies change. This has the advantage of only running the last tests you ran. 3) Run the NUnit gui as the Debug program with the /run option and a hard-coded path Charlie _____ From: [email protected] [mailto:[email protected]] On Behalf Of Josh Szepietowski Sent: Sunday, December 23, 2007 12:35 AM To: [email protected] Subject: [Nunit-users] "Failed to locate fixture" nunit-console with simpletest case Hi all, Just starting to check out NUnit and TDD in general. I want to get my environment set up such that I have a solution containing: (1) Assembly I am coding, (2) Test Assembly with NUnit tests, set to be the 'startup project' and kicking off nunit-console on it's self when it is run. So to start this off I created a new Project (TestLibrary), added a reference to the nunit.framework assembly, and added a single *.cs file with this code: ..................... using System; using NUnit.Framework ; namespace TestLibrary { [TestFixture] public class TestFoo { [Test] public void AssertTruePasses() { Assert.IsTrue(true); } } } ..................... Simple as I could think for my first test.. :) I then changed the project properties for the TestLibrary assembly as such: -Start Action: -Start External Program: C:\Program Files\NUnit 2.4.3\bin\nunit-console.exe -Start Options: -Command Line Arguments: $(TargetPath) -Wait And I press 'F5' (go run!).. The nunit-console application runs, but fails with the message: Unable to locate fixture So, can anyone help me figure out what I am doing wrong here? :) Sorry, very new to this whole NUnit thing, and it is a little frusterating to run into such immediate resistance. For the record, opening the TestLibrary.dll assembly (debug version) in the nunit gui program works fine and the test passes.. But it is import for me to integrate the tests into my build step. Thanks, -- Josh Szepietowski http://www.goosey.info ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Nunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nunit-users