Questions tagged [nunit-2.5]

For issues relating creating and running unit tests using NUnit, version 2.5.

NUnit is an open source unit testing framework for Microsoft .NET written in C#. It serves the same purpose as JUnit does in the Java world, and is one of many in the xUnit family.

91 questions
6
votes
4 answers

Catching asserts in NUnit

I'd like to log some contextual information when tests fail (like capturing screenshots). Is there any extensibility point in NUnit framework where i can do it? Ideally it would be: [TearDown] public void Down(AssertionException ex) {} but…
UserControl
  • 13,469
  • 15
  • 88
  • 171
6
votes
1 answer

How Can I get NUnit's ExpectedException attribute to detect an exception's base class?

Using NUnit 2.5.10, I am testing some code that references a library containing a base exception type. TIBCO.EMS.NamingException, from which other exception types derive, specifically TIBCO.EMS.InvalidNameException and…
John Tobler
  • 404
  • 2
  • 14
6
votes
2 answers

NUnit Parameterized tests: Setting the test description

I have written some Parameterized Tests, that use the ValueSourceAttribute for some of the test method arguments. Here from the NUnit doc: | Complete Test Cases | Data for One…
Tully Ernst
  • 95
  • 1
  • 9
5
votes
2 answers

NUnit extension

Hi All i have a question regarding NUnit Extension (2.5.10). What i am trying to do is write some additional test info to the database. For that i have created NUnit extension using Event Listeners. The problem i am experiencing is that public…
Igor
  • 115
  • 2
  • 10
5
votes
1 answer

Nunit parameterised TestFixtures with parameters set at runtime?

I'm interested in being able to instantiate multiple testfixtures with constructor arguments passed to it at runtime by a static method or property returning an IEnumerable. In Nunit 2.5 they introduced parameterised tests and test fixtures. These…
imoatama
  • 932
  • 6
  • 13
5
votes
3 answers

How to do exception handling with nunit and moq?

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…
chobo2
  • 75,304
  • 170
  • 472
  • 780
4
votes
2 answers

Supply parameters to NUnit tests at run time

NUnit 2.5 adds support for parameterized tests with attributes like ValuesAttribute and ValueSourceAttribute so that one can write something like: [Test] public void MoneyTransfer( [Values("USD", "EUR")]string currency, [Values(0, 100)]long…
UserControl
  • 13,469
  • 15
  • 88
  • 171
3
votes
1 answer

Trouble configuring TeamCity and dotCover

Im trying to configure TeamCity 6.5 with inbuilt NUNIT and bundled dotCover. For reasons I do not understand dotCover Merge command fails, along with all subsequent commands with some non-zero exit code. Using Nunit 2.5.10, x64 on a 64 bit machine,…
Zasz
  • 11,609
  • 9
  • 37
  • 63
3
votes
1 answer

nunit vs unit test framework built-in with visual studio

Anyone can give a comparison over those two frameworks?
user496949
  • 75,601
  • 138
  • 297
  • 413
3
votes
3 answers

how to use nunit with visual studio

Visual studio has a built-in unit test framework. I am wondering if I can use nunit instead?
user496949
  • 75,601
  • 138
  • 297
  • 413
3
votes
1 answer

Trace in NUnit works only while debugging from Visual Studio

I want to display trace info into Text Output tab in NUnit GUI (ver. 2.5.7, target runtime 4.0): Trace.Listeners.Add(new ConsoleTraceListener()); Trace.WriteLine("Hello NUnit"); This works fine when I launch NUnit GUI from Visual Studio (2010) via…
abatishchev
  • 92,232
  • 78
  • 284
  • 421
3
votes
2 answers

Windows UI Automation API not finding child elements when run on server

I'm using the Microsoft UI Automation API from within NUnit 2.5.10 tests to perform automated UI testing for a WPF application. There some cases where running the tests on my development machine is able to locate certain UI elements, but when the…
John M. Wright
  • 4,291
  • 43
  • 61
3
votes
3 answers

Write NUnit Test case for a method which prompts a message box

I have a method with the following structure: bool myMethod(some arguments) { //Show User Dialog } The user dialog is shown which has 4 buttons, "Yes", "Yes To All", "No" , "No To All". When I run the test case, It shows the user dialog, but…
The King
  • 737
  • 1
  • 13
  • 35
2
votes
2 answers

Initialize log4Net as early as possible with NUnit

I'm wondering what is the best way to initialize log4Net in a NUnit project. Of course I want to call the init code (ie. XmlConfigurator.Configure()) as soon as I can to get as many early log output as I can. But since my project is run through…
PPC
  • 1,572
  • 1
  • 17
  • 38
2
votes
3 answers

What is each tab in the NUnit Gui Runner supposed to be for?

There are six tabs in the NUnit Test runner: Errors and Failures Tests Not Run Console.Out Console.Error Trace Log I know what Errors and Failures are for but the purpose of the remaining tabs is confusing. Both Console.Out and Trace appear to…
MedicineMan
  • 13,795
  • 30
  • 92
  • 137