nunit

Running NUnit Tests in parallell using NANT

Hi, We have different categories of tests under various assemblies. What is the best possible way to run them in parallel? I am aware of a task in ant, is there any such task in NANT? Kind regards, ...

Does mobile 6 phones generate a .dll?

Hi I want to grab the .dll from a mobile phone application I am making since I want to add it to my nunit so I can write & test my application. Yet I don't see any .dll in the bin folder. How do I unit test it? ...

Watin Unit Tests with Nunit Timing problem

Hi i am using WatiN (version 2.0.10.928) with NUnit (2.5.2.9222) if I have something like [Test] public void WebPageTest() { string url = "www.google.com"; IE ie = new IE(url); ie.TextField(Find.ByTitle("Google Search")).TypeText("Watin"); ie.Button(Find.ByName("btnG"))....

Database free NUnit tests

How can I test my code (TDD) for standard CRUD operations without having a database. Is it possible to achieve such level of isolation so that my code is database independent. Thanks a lot guys. ...

Create Unit test methods dynamically during runtime in MSTest

Is there an equivalent of SuiteBuilder in MSTest? couldn't find one so far. I have a bunch of xml files, each to be seen as mapped to a test method. As there are 100s of these and to manually write tests for each of these, is not a good idea. So in nunit you could implement ISuiteBuilder and have the Test cases run dynamically and show...

unit testing / integration guidance for a shopping cart

Need some guidance on how to go about unit testing a shopping cart (.net mvc, c#). I want to use sqllite as I am using nhibernate so I can create an in-memory version of my database for integration testing. So I have a Cart object: public class Cart { void Add(Item item); void Delete(Item item); void CalculateTotalB...

Does NUnit have a built in way of calling tests from another unit?

Hi, I need to call a Test from a different unit to use in my current unit (by unit I mean class). Does NUnit have infrastructure to do that or should I just keep doing what I'm doing; instantiating the class and invoking the method? Thanks! ...

How can i assert that a particular method was called using nunit

How can i test that a particular method was called with the right parameters as a result of a test? I am using nunit. The method doesn't return anything. it just writes on a file. I am using a moq object for System.IO.File. So I want to test that the function was called or not. ...

How to unit test file permissions in NUnit ?

I'm trying to unit test file read operations. In this scenario I also need make sure that, if a particular user don't have read access he should get an exception... But somehow I'm unable to get it working, can anyone suggest something? PS: I'm using Rhino mock and NUnit ...

how to assign a test file in resharper?

how to assign a test file in resharper? whenever I select 'run tests' it says no test file found. I created a test project, how do I link it? ...

Nunit not releasing a DLL used in a test / can't delete in teardown

I have an application which has to interface with an unmanaged, and frankly buggy, DLL. I've compensated for this by making my application check for all sorts of error conditions on running the DLL, things like timing out in case the DLL has gone into an infinite loop. I'm trying to test that handling in my application, and so I've del...

installing asp.mvc 2 beta nunit project templates untrusted component error.

I've been trying to get nunit 2.5 to work with mvc 2 (VS2008) after following some guides and updating registries. I though I was done. I can select nunit when choosing my testing frame work but there is no test project created. When I create a new mvcapplication.nunit.tests template it fails with the error. Error: this template atte...

Dettaching Nunit from VS debug mode takes too long

I am using VS2008 and Nunit. My application uses Spring.NET Framework for dependency injection. I attached Nunit to VS to debug. Loading Nunit takes time and even worse after the test fails/success, I stop it. deattaching duration is more than 2 minutes. I tried to restart everything, clear the cache on "\WINDOWS\Microsoft.NET\Framework...

How to pass the assembly name as a command-line argument when debugging

I have an NUnit test assembly (a .NET DLL). When I click Run in Visual Studio I want it to launch NUnit and run the tests in this assembly. I can do all of that. Instead of specifying the full assembly name and path in the command line arguments, does Visual Studio support some sort of macro that expands into that for the Command Line...

How do I get ReSharper to ignore certain categories when running all tests?

I've got about 650 NUnit tests in my current solution in VS2008, but 40 of these are categorized either as "LongRunning" or "Integration". I do not want these to run every time I've done a change and run my test-suite (only when I specifically ask for it, and on the CI at set times). Setting this up with TestDriven.Net is a cinch: Tools...

Running NUnit Tests In a C# Console App

I need to run NUnit tests programmatically in a console app. Using NUnit's nunit-console.exe is not an option. My current code is: var testRunner = new SimpleTestRunner(); var package = new TestPackage("MyTests.dll", new List<string> { ("c:\MyTests\MyTests.dll" }); testRunner.Load(package); When I call Load, NUnit looks for the dll ...

Unit Testing Sqlite Membership Provider in MVC app

I've created an MVC application and I've set up Roger Martin's sqlite Providers in place of the default Providers. I'm curious about how I would go about unit testing these. Below is a stripped down method that has many validations, only one of which is still present. Among other things, I want to write tests that ensures one can't ...

msbuild: TestRunConfig for NUnit

We are migrating from mstest to NUnit. The first step was to migrate all our UnitTests projects which was accomplished using the following msbuild task: <Target Name="RunTests"> <!-- The location of the necessary tools to run nunit tests --> <PropertyGroup> <NUnitToolPath>C:\Program Files\NUnit 2.5.2\bin\net-2.0</NUnitToolPath> <...

KeyNotFoundException, but not when debugging.

I've been building an extensions library, and I've utilised a great extension method found at http://www.extensionmethod.net for inclusion. In my unit test (using NUnit 1.5.2), I've come across an interesting issue. Firstly, lets look at the code: /// <summary> /// Groups and aggregates the sequence of elements. /// </summ...

Environment.CurrentDirectory with NUnit GUI differs to the TeamCity value, how can I sync them?

As above really, I have some integration tests that use files from a relative file path. To help picture it here is the file structure: /Dependencies /VideoTests/bin/release/video.dll /SearchTests/bin/release/search.dll /OtherProjects The GUI is running the tests from the root, however when TeamCity runs the tests it is running the te...