Questions tagged [nunit]

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

nunit
1,910 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
0 answers
466 views

How to use NUnit TestCase with internal type as argument

I have got stuck while writing some tests when wanted to use TestCase attribute with some parameters. I wanted to specify multiple test cases with some inputs and outputs but one of it is of type ...
Dawid Komorowski's user avatar
1 vote
0 answers
193 views

Nunit 3.2.1 failing only when using console runner

I'm developing framework using c# and selenium. When I am using ReSharper to run my tests everything is working fine. TCSA = TestCaseSource artibute But I have strange problem with Nunit 3.2.1 ...
vTad's user avatar
  • 319
1 vote
1 answer
1k views

How to override NUnit test results on retry

I was trying to rerun failed case as below but while marking test case as pass on 2nd run getting below exception at Assert.Pass() step. How to resolve this error? Exception: NUnit.Framework....
raj's user avatar
  • 71
1 vote
1 answer
1k views

Bamboo nunit runner not finding tests

I'm developing testing framework using .net + selenium with Nunit 2.6.4 runner. I configured bamboo to run test in that way: Checkout from repository Parametrize tests Nuget restore MsBuild with ...
vTad's user avatar
  • 319
1 vote
1 answer
412 views

Selenium (Nunit) with MTM (Microsoft Test Manager)

I want to perform automated test with Selenium,Nunit,TFS and MTM. As i'm trying to find a way to run my selenium code using Nunit with MTM, i've searched alot regarding this but didn't find required ...
Neel Gurbani's user avatar
1 vote
0 answers
91 views

Custom CategoryAttribute does not work if defined in a referenced assembly

I created a demo custom CategoryAttribute in the same assembly as my test fixture: [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public class CustomAttribute : CategoryAttribute {...
bugged87's user avatar
  • 3,076
1 vote
0 answers
1k views

C#: Stop Git commit if NUnit test fails

I have a VS Solution the structure of which you can see here: Solution Explorer Screenshot I'm using NUnit 3.2.0 to run my tests. How can I stop commits to my local branch if the NUnit test fails ...
Pallab Pain's user avatar
1 vote
0 answers
389 views

How to increase page timeout for

I am writing some webdriver test and one of my test cases consistently times out in Firefox only. I am running into this exception when a page is loading. I am only running into this issue with ...
Buster's user avatar
  • 705
1 vote
0 answers
697 views

NUnit: To get Error message

I would like to know Is it possible to get error message (reason of why my testcase failed). For instance, below is my code of I am trying to find an element it will fail my test. Error message will ...
user1413's user avatar
  • 537
1 vote
1 answer
611 views

Why is Parallelizable attribute not showing in my SpecFlow feature.cs files

I'm using NUnitv3 with SpecFlow 2.0, ive added the attribute [assembly: Parallelizable(ParallelScope.Fixtures)] to my assemblyinfo.cs and have regenerated all of the steps. However what im noticing ...
Festivejelly's user avatar
1 vote
1 answer
518 views

Can Scenario Outline auto generate data from filesystem?

I am trying to run a set of steps for testing the processing of files in a given folder. I would like to be able to see each processed files result rather than one executing to the first failure. ...
izzy coding's user avatar
1 vote
1 answer
327 views

Unit Test deleting files without reason

In my solution I have a bunch of projects which contain content files and some static classes with string to those files relative paths. I also have some test projects which contain tests and test ...
user3161729's user avatar
1 vote
1 answer
1k views

Path Issue Causing System.IO.FileNotFoundException

I added a solution to my project, just for unit tests (NUnit) I have included references to all of the dlls the test solution needs but.. I am getting the following file not found error: System.IO....
Slinky's user avatar
  • 5,712
1 vote
1 answer
702 views

Nunit 3.0 Tests not running in parallel in TeamCity

We have a suite of API tests that we have been running on Teamcity with MBunit. There are around 200 tests that are set to run 12 in parallel and they take about 7 minutes to run. Nunit recently ...
Ryan Andersen's user avatar
1 vote
0 answers
85 views

Jenkins NUnit plugin lacks useful info

We have implemented some integration tests using NUnit under Jenkins and have used the NUnit plugin to produce a report output. But the output is devoid of any useful info, especially error messages ...
SC_Adams's user avatar
  • 156
1 vote
1 answer
1k views

Make all tests run multiple times with different environment setup

All tests create same "root object" in my system and the "root object" has multiple modes. I need each test to check everything against each mode. So I decided to make an internal static property in ...
Vlad's user avatar
  • 3,099
1 vote
2 answers
216 views

How to know which tests were run together in parallel?

My question in general is this: when I run automated tests in parallel how can I know which of them were run at the same time? My issue is this: I'm running tests in parallel (4 tests per time) but I ...
Denis Koreyba's user avatar
1 vote
0 answers
352 views

Add additional search path to NUnit testing

I have a question about how to add an addtional search path to NUnit testing. Although I know it's not best practice, I need it for some reason. Let me description the directory structure first: ...
Jian's user avatar
  • 11
1 vote
1 answer
195 views

Dynamically test fields translated through AutoMapper

I want to map from class A to class B. However, class A has a few property name mismatches with class B and has quite a few nullable types. In the case of a null, I'm supposed to provide a default ...
user1080952's user avatar
  • 1,123
1 vote
0 answers
2k views

Spring.Data.CannotGetAdoConnectionException : Could not get ADO.NET connection

We have a bunch of unit tests running on the build server using this command line: mkdir "%WORKSPACE%\Results" del /Q "%WORKSPACE%\Results*.*" NCover Run --project="%JOB_NAME%...
Anda's user avatar
  • 13
1 vote
0 answers
81 views

NUnit request-reply pattern

I am working on a console application that calls certain tests from an external dll using a filter from a test suite. All these are made up with NUnit framework(version 2.5.0.9122). I want to know if ...
Alexandru Zagrean's user avatar
1 vote
0 answers
280 views

adding dll path on Team city for nUnit runner

I tried a lot,but still not getting proper link and articles which can sort out my problem. I have some NUnit test(s), which I want to integrate with TeamCity server; for this I am using the NUnit ...
Raj's user avatar
  • 151
1 vote
0 answers
91 views

Selenium timeouts implementation through the Page Factory model

Please share your experience on the timeouts implementation in case of Page Factory model. In case of simple variable usage (var loginButton = driver.FindElement(By.Id("login")), there are ...
Victor Kondin's user avatar
1 vote
0 answers
307 views

Xam.Plugin.Connectivity doesn't work in .Net 4.5 Unit Test Project

When using Xam.Plugin.Connectivity 2.0.0 via Nuget package in a PCL which includes .Net 4.5 as target, and using this PCL in an NUnit test project, a NotImplementedException gets thrown. Here's the ...
backendev's user avatar
  • 267
1 vote
0 answers
98 views

How can I write a test-mutation in F# using Ninja Turtles?

How can I write a test-mutation in F# using Ninja Turtles? Here's my test mutation (C#): using NinjaTurtles; using NUnit.Framework; namespace Tests { [TestFixture] public class _MutantTest ...
Scott Nimrod's user avatar
  • 11.4k
1 vote
1 answer
989 views

NUnit 2.6.4 and 3.0.0 test adapters installed at the same time: How do I prevent both from running?

I am using Visual Studio 2013. Let's say I have a version 1.0 of a product which is currently using the NUnit Test Adapter. I now want to move v1.0 to a branch and start working on v1.1. I want to ...
Joergen Bech's user avatar
  • 1,455
1 vote
0 answers
251 views

Injection of new properties to a class with variable names using Postsharp or other injection library

TLDR: is it possible, and if so, how, to inject or copy-then-rename methods in .NET projects using some injection mechanism? Somehow I thought this was simple enough to do, I guess I never had a need ...
Abel's user avatar
  • 56.5k
1 vote
0 answers
209 views

Rebuild of common dependencies when running NUnit tests in Visual Studio

I have a package FooTests that depends on both Foo and Bar. Bar also depends on Foo. Whenever I change Foo, and run FooTests, I expect the NUnit VS Test Adapter to rebuild Foo. And that's happening ...
wrschneider's user avatar
  • 18.4k
1 vote
0 answers
214 views

Publish NUnit test result grouped / labeled

I try to publish nunit tests results on jenkins, grouped (unit test, performance test). I use NUnit plugin to publish. I checked LabeledTestGroupsPublisher Plugin to group but it works probably only ...
user3698600's user avatar
1 vote
1 answer
929 views

Resharper/Nunit AssertionException was unhandled by user code

I am trying to set up unit testing in a solution with Visual Studio Enterprise 2015 and Resharper Ultimate 2015.2. I created a new unit test project in the solution and used NuGet to install Nunit ...
James Allman's user avatar
  • 40.8k
1 vote
4 answers
214 views

Verify methods are called in order

I have the following method: public async Task DeleteAmendment(int amendmentHeaderId, int userId) { // Delete the corresponding version records. await _amendmentVersionService....
swade1987's user avatar
  • 1,673
1 vote
0 answers
998 views

Any way to build test project to standalone exe?

I have NUnit test project in my solution. I'd like to be able to run its tests on a set of different environments using a network of virtual machines and then aggregate result XMLs from each machine ...
SimpleV's user avatar
  • 396
1 vote
0 answers
36 views

Nunit Mocking is little bit of confusing

How to mock the query, I want to test this in Nunit. Can someone help me with snippet?this is the exact Service.cs, I need to mockup and do an Nunit on the same. internal class Sample : ISsample { ...
ravi's user avatar
  • 198
1 vote
0 answers
98 views

Nunit 3.0 Beta 4; Test Cases are not being discovered using TestCaseSource

I've a project where I'm reading a excel file for the test cases.The code for reading the excel and mapping the cases to C# classes is being done like this class AllTests{ public static IEnumerable ...
Ankit Gupta's user avatar
1 vote
0 answers
99 views

Prevent NUnit from executing test setup method from another class?

I've got an odd question for which Google has proven barren: I've got a project in .net with ~20 classes that all have tests in them. One of the classes has common test setup code, although a few of ...
Tyler Desmond's user avatar
1 vote
0 answers
114 views

Is posible to set nunit Category based on ValueSource?

I have test with parameter like this: class Test { [Test, Category("somecategory")] public void SomeTest([ValueSource(typeof(Data), "Variants")] string variants) { // code for test ...
nEkis's user avatar
  • 340
1 vote
0 answers
143 views

Multiple test adapters in TFS 2013 build

I am developing a software that contains multiple solution and uses: Nunit Test Adapter: C# Solution Boost Test Adapter: C++ Solution until now what i am doing is use a version control path to ...
Kanekotic's user avatar
  • 2,894
1 vote
2 answers
1k views

Coded unit test, database and Dependency Injection

I have following questions related to the code unit tests for the classes which are pretty much integrated with the database logic. E.g. My class method calls another class that executes a database ...
Learner's user avatar
  • 4,701
1 vote
0 answers
811 views

How can I write the trace, console and error outputs into my XML report file?

I want the Trace, Console and Console Error outputs would be written into the common XML report file (for example into cad.UnitTests.xml). By default this info is not written in XML. How can I do it?...
Andrey Bushman's user avatar
1 vote
1 answer
448 views

NUnit GUI is not finding the app.config file

I have an ASP.NET MVC application that I'm using NUnit to write tests for. The NUnit GUI is unable to find the app.config when I run the test. My NUnit test project is located in the bin/debug folder ...
J. Nick Baughan's user avatar
1 vote
1 answer
822 views

xunit.runners.1.9.2 - Failed to resolve profiler path from COR_PROFILER_PATH

I am using Xunit test framework along with MS Fakes mocking framework within visual studio. It works fine when I run my tests within visual studio, but when I try to run my tests on build seerver ...
rajcool111's user avatar
1 vote
2 answers
3k views

How to execute selenium NUnit test cases from jenkins

I have installed Jenkins and want to execute selenium test cases from Jenkins. I have installed selenium grid plugin for Jenkins and running a server as node. My scripts are written in c#. For Java, ...
neerajhatwal's user avatar
1 vote
1 answer
563 views

Creating testcases using nunit and moq on WEB API controllers

I am trying to create a unit test cases using nunit on controllers in an existing Web API project. I am using Moq as mocking framework. In here I would like to mock repository to return some expected ...
rednerus's user avatar
  • 401
1 vote
1 answer
111 views

SimpleAuthencation throwing "Failed to reflect on the current domain's Assemblies while searching for plugins"

I have a NancyFX web project using SimpleAuthentication that works fine when self-hosting from the terminal. When I self-host from unit tests (NUnit runner with Xamarin Studio), I receive exception "...
Frank Schwieterman's user avatar
1 vote
0 answers
264 views

Cannot run tests using NUnit Test Runner from SpecFlow feature files

Using the current version of ReSharper (9.1) and NUnit (2.6.4), whenever I right click a feature or step in a feature file and click ReSharper's "Run Unit Tests" it throws an error and says no unit ...
Brian Deragon's user avatar
1 vote
1 answer
90 views

NUnit-Selenium exception is not considered Failed

I use this code to validate Failure in NUnit at end of test execution- if (TestContext.CurrentContext.Result.Status == TestStatus.Failed) { do something } The issue I have is the Selenium ...
ReuseAutomator's user avatar
1 vote
1 answer
1k views

Why Does Visual Studio not give me a test in Test explorer when I build my project?

I have attempted this in a few ways but never have a test after I hit build I have written a test using Nunit and am not sure what I need to do. using OpenQA.Selenium; using OpenQA.Selenium.Remote;...
user1622681's user avatar
1 vote
1 answer
326 views

Formed an incorrect Allure report if run tests from the command line of TeamCity

I was faced with the following problem: I run the tests through NUnit console, using the command line of TeamCity. At the output I get the wrong Allure report: wrong status and no screenshots for ...
BCR's user avatar
  • 71
1 vote
0 answers
255 views

Async NUnit Test with await not listed in VS2013 Test Explorer

I ran into following problem. A NUnit async test using await to await a call returning GetCustomDataAsync is not listed in the Test Explorer. In the same, an async test await a call returning int ...
1ppCH's user avatar
  • 276
1 vote
1 answer
365 views

NullReferenceException with Assert.That and NunitLite

I'm using NunitLite for my unit testing for a Xamarin project. Environment: Windows 8.1 64 bit Visual Studio 2012 Test project class library referencing .NET 4.5 NunitLite V1.0.0 package from NuGet ...
James Lavery's user avatar

1
10 11
12
13 14
39