I am writing some unit tests with NUnit 3.0 and, unlike v2.x, ExpectedException() has been removed from the library.
Based on this answer, I can definitely see the logic in trying to catch specifically where in the test one expects their system to…
I am trying to port a test to NUnit3 and am getting a System.ArgumentException : 'async void' methods are not supported, please use 'async Task' instead.
[Test]
public void InvalidUsername()
{
...
var exception =…
I want to run tests from a console like this (being in any directory, the DLL file can be for a different .NET version):
$ nunit3-console test.dll
I googled a lot, but can't find how to set up this.
The official tutorial has nothing useful and is…
I have the latest NUnit(3.2.0) installed and I have all my tests run in parallel. It might look like desirable behavior but I didn't ask for it and actually it broke some of my tests. I have some initialization in [OneTimeSetUp] which is…
I have to refactor am unit test from NUNIT 2 to NUNIT 3 and the following syntax throws an error:
var expectedResponseMessage = new HttpResponseMessage();
Func> continuation =
() => Task.Factory.StartNew(() =>…
It seems that Fluent Assertions doesn't work within NUnit's Assert.Multiple block:
Assert.Multiple(() =>
{
1.Should().Be(2);
3.Should().Be(4);
});
When this code is run, the test fails immediately after the first assertion,…
The Environment:
I've got three projects in my solution currently:
A .NET Standard 2.0 library with some code I'd like to test.
A .NET Core 2.2 console app that references the library to make sure it works.
A .NET Core 2.2 console app created by…
I am running the NUnit tests (project in .Net Framework 4.5), as part of azure devops build pipeline.
- task: VSTest@2
inputs:
testAssemblyVer2: 'tests/**/*.Tests.dll'
pathtoCustomTestAdapters: '$(Build.SourcesDirectory)/packages'
…
I have a webappliction with a separate test-project using NUnit to run unittests. When my test-project is trying to discover tests I run into the following exception:
An exception occurred while test discoverer 'NUnit3TestDiscoverer' was loading…
I'm using NUnit3 in Visual Studio 2017 and doing TDD. Something really strange is happening since I updated my code to make my latest test pass.
Now, 3 of my other tests are failing when I click Run All Tests, as below:
It is telling me that the…
I'm currently rewriting some unit tests to use NUnit 3 instead of NUnit 2 and need to change some asserts to contraint-based asserts. I have the following asserts:
Assert.IsNullOrEmpty(result);
That I've changed to:
Assert.That(result,…
I have an ASP.Net Core 2.0 web application I am retrofitting with unit tests (using NUnit). The application works fine, and most of the tests thus far work fine.
However, testing the authentication/authorization (does a user get logged in and can…
Consider:
[Test]
public void Test1()
{
Trace.TraceInformation("Hello");
}
When running it from Visual Studio 2015, the output window (Tests) shows no trace lines:
------ Discover test started ------
NUnit Adapter 3.4.0.0: Test discovery…
My test fails because of the message:
The sourceName specified on a TestCaseSourceAttribute must refer to a static field, property or method.
This is my Code:
const double MAX_DELTA = 0.01;
Qv_ges qv_ges_NE;
double Sum_Qv_ges_R_FL;
Qv_ges…
NUnit 3.0 is supported by TeamCity 9.1.x now however you have to install the runner and specify the path to the nunit3.console.exe in the step. My question is where do I copy the nunit3-console.exe? Do I have to put this on all the agents? Do I…