NUnit 3.0 ExpectedResult is still null

Migrating tests from NUnit 2.x to 3.x I replaced Result attribute with ExpectedResult for every TestCase. Anyway seems that ExpectedResult does not get the value passed. My Code: [TestFixture] public class HashToolsTest { [TestCase("Cantami o diva de

Running ZeroMQ Unit Test - address already in use

I'm trying to run two ZeroMQ REQ/REP endpoints under test using TCP protocol. The first test executes fine. The endpoints are then disposed (via a call to Dispose() on socket and context), however the second test (using the same TCP endpoint address)

Visual Studio 2012 MSTest vs NUnit Pros and Cons

We have to decide which technology to use for our unit testing. Currently we use Visual Studio 2010 and not happy with MSTest that came with that. It is buggy, poor in deployment (E.g the test setting output directory is not recognized correctly), an

Incorrect configuration file when running NUnit tests (TD.NET)

I have a component that reads some configuration from the standard .NET configuration (app.config) file. when I run unit tests (NUnit) for this component (using TD.NET), i noticed that the configuration file is not read. Upon inspection of AppDomain.

SpecFlow and complex objects

I'm evaluating SpecFlow and I'm a bit stuck. All samples I have found are basically with simple objects. Project I'm working on heavily relies on a complex object. A close sample could be this object: public class MyObject { public int Id { get; set;

What is the proper way to test a sequence of complex objects

What is the correct way to unit test a method that returns a sequence of complex objects? I'm implementing a branch finder. I have a repository that returns a Branch object which has various information such as Branch name Address Location Products s

How to access the NUnit test name programmatically?

Is there some global state somewhere that I can access the currently-running test name? I have tests which output files into a directory and read them back in. I'd like each test to create a directory to play in and then clean up after itself, and I

How to avoid over-testing in a test scenario? (C # / nUnit)

I'm working on some test cases at the moment, and I'm regularly finding that I'm ending up with multiple asserts in each case. For example (over-simplified and comments stripped for brevity): [Test] public void TestNamePropertyCorrectlySetOnInstantia

NUnit test in mono

I have a mut.cs as follows. using System; namespace ns { public class Arith { public int Add(int x, int y) { return x + y; } public int Mul(int x, int y) { return x * y; } } } I came up with a Unit test for this - mut_test.cs using NUnit.Framework; u

Unit test with an external host process dependency

I'd like to run some NUnit unit tests against a class in a .Net class library assembly which is designed to be hosted by an external process (outside of my control) and loaded at runtime. The class I want to test derives from a class defined within t

Run NUnit tests automatically from the command line

I'm launching the NUnit gui from visual studio by setting the test project to start start nunit 2.5.3 as an external program. That loads the tests into the GUI but I still have to manually click the run button. Is there a command line argument that w

Database dependent window service unit tests

We have a set of services in .NET 3.5\C# and WCF. The NUnit tests need the services to be running and listening for requests. The services need an updated SQL database to be ready for connection. Currently the [SetUp] section of the unit test does tw

Testdriven.Net and NUnit Exception

Recently something happened to my TD.Net environment. When running tests with TD.Net, its looking for nunit 2.4.6. This happens with any project that uses NUnit as my testing framework. No references to that version in any of my projects. Have un-ins

Theory vs Nunit Test

I was just reading through the Nunit 2.5 docs and came across the Theory attribute, and I'm having a little bit trouble understanding how this is different to a normal unit test and how it could be used. What makes it different from a normal test? Wh

Unit tests with Moq, Silverlight and NUnit

I am attempting to unit test a Silverlight 3 project. I am using: Moq.Silverlight (3.0.308.2) NUnitSilverlight (http://www.jeff.wilcox.name/2009/01/nunit-and-silverlight/) When I write a test that does not use Moq, it works as it should. When I use M

Why would I want to use the debug mode of the .NET compiler?

I was curious what the differences are between the debug and release modes of the .NET compiler and came across these questions about debug vs release in .NET and reasons that release will behave differently than debug. Up to this point I really have