nunit

Converting NUnit Test Project to MS Test

Hello, Has anyone tried to replace NUnit tests with MS Test, and would be willing to share any tips or points about the complexity? I was considering this, but I have a lot of tests, so outside of assembly/type switching/attribute replacement and all, any pointers? Thanks. ...

Testing ProcessStartInfo processes execution

Let's assume I have some method that executes CLI application. For example: public string SomeMethod(string cmd) { var p = new ProcessStartInfo(cmd); // processing execution results return result; } How can I change this method to make it testable? I see that I can split that method into 2: 1. Executes CLI app and passes ...

Asserting two List<List<T>> Are Equivalent to Each Other

To make sure that two lists are the same, in nunit, we can use CollectionAssert.AreEquivalent to check that these two lists contain the same elements ( orders not important). But how to check whether two List<List<T>> are equivalent? The idea is that if one List<T> has the same elements as the other List<T> ( again, order not important)...

Comparison permormance Nunit vs MsTest

Hi, I'm trying to find good comparison about performance of mstest(VS 2008) and nunit(newest). I have found only atricles about features, not examples about times of execution :/ I would be grateful for help ...

NUnit 2.5.7 Breakpoint still not hit (VS2010) even after attaching to the Agent

Hello All, I am having a problem hitting the break point in debugging under VS2010 under NUnit recent recommended release 2.5.7 I have tried various ways as recommended by responses on Stack Overflow: 1) Attach to NUnit-agent.exe 2) Run time is correctly selected to 4.0 3) Attaching to Nunit.exe which does not even debug symbols When a...

NUnit secondary thread exception

I'm testing the code which starts a secondary thread. And this thread sometimes throws an exception. I'd like to write a test which fails if that exception isn't handled properly. I've prepared that test, and what I'm seeing in NUnit is: LegacyImportWrapperTests.Import_ExceptionInImport_Ok : PassedSystem.ArgumentException: aaaaaaaaaa a...

How to test callbacks with NUnit

Is there any special support when you come to test callbacks with NUnit? Or some kind of of "best practice" which is better than my solution below? I just started writing some tests and methods, so I have still full control - however I think it might be annoying if there are better ways to test callbacks thoroughly, especially if comple...

NUnit 2.5.7 requires explicit Debug Attach under VS2010

I've just "upgraded" from NUnit 2.5.2 to NUnit 2.5.7 so that I can run unit tests against an dll's built with .Net Framework 4. I've been using 2.5.2 for a long time via the "StartExternalProgram" property uner project properties. I've never had to explicitly debug attach to the NUnit process in that scenario. Now under 2.5.7 it appear...

NUnit unit test cannot find a unmanaged dll in the test class

I'have the following situation: I have a delphi dll (unmanaged) that works. I have a win forms application (a proof of concept application) that works. The dll (and all its dependencies) are copied in the Bin/Debug directory of the application. I've createad a .NET managed library which has a class that is a wrapper around the dll. all...

The membership provider name specified is invalid. Parameter name: providerName

.Net4.0 MVC 2 NHibernate NUnit I'm trying to test user creation. From my test, I'm calling the following: MembershipCreateStatus status; // _session is my current NHibernate session. var mmp = new MyMembershipProvider(_session); mmp.CreateUser(username, password, "[email protected]", "", "", true, Guid.NewGuid(), out status); ...

Using IoC container as a service locator for HttpHandler

This question relates to my other post. Ok so after a bit more messing around I decided to do it this way. Which seems to work fine when I run it, although I'm getting the following error in NUnit: Could not load file or assembly 'Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies....

Someting like Xml asserts for NUnit

Does NUnit support (perhaps by using a third party libraries) a smart comparison for xml data. Let's say we need to compare two xml files - the simplest way would be to compare xml content using the no-case sensitive string comparison, but that would only work in a trivial cases. Is there any library around which could simplify xml com...

Using NUnit to test that an IEnumerable was sorted correctly (uses nested sort)

I'm using MVP with ASP.NET Web Forms. Being a good TDDer, I want to test all the important behaviors in my Presenter, including the default sort it applies to the result set retrieved from the service layer. The Presenter will be applying a nested sort via LINQ to Objects of the style: public IEnumerable<ViewModel> MyModel{ get ...

How can I force all tests to have a single category in NUnit?

I'm using NUnit 2.5.3, but if a more recent version of NUnit solves my problem, it won't be an issue to upgrade. We have a couple of different categories for tests. Different categories of tests will be run during different flavours of build (fast running unit tests for checkins, all unit tests and other tests with external dependencies...

Multiple [SetupTest] for different configs.

Is it possible to have multiple [SetupTest]'s in a fixture? I am using Selenium and nUnit and would like to be able to specify the Browser on which the user wants to test. I have a simple user GUI for selecting tests to run but, I am aware that in the future we want to hook this up to cruise control to run the tests automatically. I...

[Test] used in multiple [TestFixture]s

I'm in the process of setting up tests in NUnit and have a newbie question. Is it possible to have a Test/s that could be used in multiple [TestFixture]s? So [Test]ValidateString(string bob) Could be called in a series of different [TestFixture]? ...

N-Unit testing WCF with Callbacks

Hi All, I am unit testing a WCF service. The flow goes like this. Application(Client) insert command to the DB through Webservice1. This is done using duplex pattern.(with callbacks). WebService1 inserts the command to DB and this Webservice1 invokes another webservice2 about the arrival of new command.(Duplex pattern). Webservice2 ...

Mocking, Unit Testing (NUnit) setup problem with HttpHandler

This post relates to two other posts, here and here. I'm new to Unit Testing & Mocking. I have a test fixture that is trying to mock a HttpContext object including the response and request. I think the test code is not setup properly, as after calling the handler I get an error immediately. There error I am getting is: UnitTests.UADHan...

Difference between double comparisons in gtest (C++) and nunit (C#)

I have done porting of a c++ project with gtest tests to a c# project having an nunit test. Now I encounter problems with floating point precision. in the nunit test I have being not ok (red) Assert.AreEqual(0.7, 7 * 0.1); in the gtest test I have: ASSERT_DOUBLE_EQ(0.7, 7 * 0.1); which is ok (green) The question now is WHY??? ...

Strategy for Automated UI testing on remote virtual machines

I'm using TeamCity for my CI builds, and I'd like to set up a second build for running automated UI tests on Windows XP and Windows 7 virtual machines. I imagine the build working as follows: Compile, run unit tests, etc. Prepare MSI using WiX Copy MSI to target test machines Remotely execute MSI's Copy test harness code to remote m...