nunit

Stop running tests on setup failures

We are using NUnit to run a large number of integration tests. All these tests share a base class, which as a test fixture setup method that preps the data needed for the rest of the tests. Is there any way to stop running tests if there is a failure in the test fixture setup? Right now it waits until all the tests fail with the same ...

Using NUnit with .NET 3.5

Does NUnit work with .NET 3.5? i've the page says it's for .NET 2.0... ...

Nunit in VS Tutorial

I'm looking for a tutorial that shows how to use NUnit's integration with visual studio to set up some simple unit tests, does anyone know of one? ...

How to queue the list of NUnit test cases

Can anybody tell me how to queue up the NUnit test cases.e.g. if i want to run my 5 test cases in 2,4,1,3,5 order how can i assign them to do so? And where? ...

XML data for Unit testing

We are looking to run a large amount of data through some unit tests. We would like to define this in some sort of excel spreadsheet or XML document. Is there away to get the unit testing framework to load this data as input and expectations. I can foresee this having issues with exception catching. Any comments on this are appreciat...

How can I prevent AppDomainUnloadedException after NUnit tests PLINQ code?

How can I diagnose and minimize or prevent AppDomainUnloadedException? NUnit 2.5.2 consistently throws AppDomainUnloadedException after long (>10s) tests involving PLINQ. Back in July 2008, Stephen Toub said: Yes, the scheduler in the CTP doesn't handle thread aborts very well, which frequently causes the process to crash when...

Visual studio NUnit integration

Hi, For some project templates (ASP.NET MVC, WPF MVVM app...), Visual Studio 2008 prompts the user if he wants to create a test project : However, in the list of test frameworks, only "Visual Studio Unit Test" is available. I'd like to be able to choose NUnit instead... Is this possible, and how ? I installed TestDriven.NET, but it ...

How can I change the working directory for NUnit tests in Team City?

Hi, I am using Team City as the build server, and I have a msbuild build script to build and run integration tests for my project. However, Team City when running my tests decides to ignore the WorkingDirectory attribute on the NUnit task, and as a result my tests fail to initialize: [17:46:54]: [Project "MyProject.msbuild.xml.teamcity...

Recommended Tutorials and videos to learn nunit testing in short time

Can you Recommended Tutorials and videos to learn nunit testing in short time. I know that there are a lot of good books talking about unit testing, but i just want to learn it short and i will go more deep using these books later. So if you know some good videos or nice tutorials, please share. ...

How to properly unit test calling UI method on another thread?

Having coded an extension method (based on http://stackoverflow.com/questions/723532/gui-update-when-starting-event-handler-class-on-separate-thread/723584#723584): public static class ControlExtensions { public static TResult InvokeEx<TControl, TResult> (this TControl control, ...

Unit testing and the scope of objects - how to test private/internal methods etc?

Let's say I have a project that is a class library. I have a class in that library and this class has some methods that are used inside the class only. Like this: public class MyClass { public void MyPublicMethod { int k // do something ... int z = MyInternalMethod(k); // do something else ... } internal int ...

SubSonic 3: Unit Tests were working but now it cannot find the connection string

I had set up a bunch of NUnit unit tests using the Test connection string in my App.config file and everything was working fine. Then all of a sudden all my tests stopped working and threw the same exception: System.ApplicationException : Connection string 'ApplicationServices' does not exist Yet here are the contents of my Ap...

NUnit doesn't work well with Assert.AreEqual

Hi! I'm new to unit-testing and NUit in particular. I'm just typing some examples from the book which refers to Java and JUnit. But I'm using C# instead. The problem is: I've got a class with overriden methods such as Equals() and GetHashCode(), but when I am trying to compare two objects of this class with Assert.AreEqual() my code is ...

"Virtual Path Not Known" When running ASP.NET MVC Unit Test Project!

Does anyone know why is it not possible to get the virtualpath when you are running the asp.net mvc unit test project? Is it because it creates a Temp folders under TestResults Folder.?? ...

Implementing repository pattern with entity framework. Problem resolving entity in scope of repository.

Hi, I'm trying to implement the repository pattern using a generic repository like the one found here: Implementing Repository Pattern With Entity Framework I've created a test suite (I'm using NUnit) to test the repository but I've been having issues. Here's the error I'm getting: MyBusiness.Test.Domain.RepositoryTest.SelectCol: ...

RhinoMock vs. TypeMock vs. NUnit's Mocking?

I am just starting to do Test Driven Development, and I am wondering the major differences between RhinoMock, TypeMock, and NUnit's built-in mocking? Any information would be greatly appreciated! ...

How to mock a generic repository using NUnit.Mocks ?

I'm working on a generic repository and I would like to test it using a NUnit.Mocks . According to Mike Hadlow in his article you can do it using Rhino mocks like this: User[] users = new User[] { }; ... Expect.Call(userRepository.GetAll()).Return(users); So I thought maybe I could write the same thing in NUnit.Mocks like this : data...

How do I specify test method parameters with TestDriven.NET ?

Hi, I'm writing unit tests with NUnit and the TestDriven.NET plugin. I'd like to provide parameters to a test method like this : [TestFixture] public class MyTests { [Test] public void TestLogin(string userName, string password) { // ... } ... } As you can see, these parameters are private data, so I don'...

How to unit test TimeZones?

Hi I am wondering how to you test TimeZone logic? For me my timezone stuff is used to filter data from the database(what of course in unit tests gets mocked up and not tested). But I would like to test the logic around it to see if I give certain times in that it would be converted right. I am not sure how to do this though. ...

How to do exception handling with nunit and moq?

Hi I am trying to use nunits new way of exception handling but I am finding it hard to find information on it and how to also use it with moq. I have right now moq that throws a exception on a mocked method but I don't know how to use nunit to catch it and look at it. ...