nunit-3.0

ASP.Net Core 2.0 SignInAsync returns exception Value cannot be null, provider

被刻印的时光 ゝ 提交于 2019-12-03 16:10:45
问题 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 access [Authorize] filtered actions) is failing with... System.ArgumentNullException: Value cannot be null. Parameter name: provider ...after... await HttpContext.SignInAsync(principal); ...but it is not clear what in fact is the underlying cause.

How to fix Could not load file or assembly 'nunit.engine, Version=3.7.0.0

浪尽此生 提交于 2019-12-03 09:06:21
问题 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 tests. Exception: Could not load file or assembly 'nunit.engine, Version=3.7.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The system cannot find the file specified. This is of course a very common error, but I can

ASP.Net Core 2.0 SignInAsync returns exception Value cannot be null, provider

点点圈 提交于 2019-12-03 05:37:46
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 access [Authorize] filtered actions) is failing with... System.ArgumentNullException: Value cannot be null. Parameter name: provider ...after... await HttpContext.SignInAsync(principal); ...but it is not clear what in fact is the underlying cause. Code execution stops in the called method here and no exception is shown in the IDE but code execution

How to install nUnit 3 nunit3-console.exe in TeamCity 9.x

不打扰是莪最后的温柔 提交于 2019-12-03 05:11:22
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 put it in a directory on my main TeamCity server and it will get shared or pulled by the agents? There doesn't seem to be good documentation on where to copy these files so that all the agents can use them. You should have the NUnit console on the each agent where you would like to run NUnit tests. The best option is: Add reference to the NuGet package

How to fix Could not load file or assembly 'nunit.engine, Version=3.7.0.0

匆匆过客 提交于 2019-12-02 23:18:06
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 tests. Exception: Could not load file or assembly 'nunit.engine, Version=3.7.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The system cannot find the file specified. This is of course a very common error, but I can't find a reference to this particular assembly anywhere or what other dependency is actually causing

TestContext property is null

為{幸葍}努か 提交于 2019-12-02 19:59:28
问题 i have been tryign to get current test directory from where tests are running. code that i m using [TestFixture] public class ValidatePDF { public NUnit.Framework.TestContext TestContext { get; set; } [SetUp] public void Init() { string t = TestContext.TestDirectory; } } TestContext is always null. i m using Visual Studio 2017 , and NUnit 3 i have tried with MS TextContext but it always return null public Microsoft.VisualStudio.TestTools.UnitTesting.TestContext TestContext { get; set; } [Test

VSTS Build fails running NUnit tests

◇◆丶佛笑我妖孽 提交于 2019-12-01 04:42:44
问题 When building a visual studio solution using visual studio team services it runs the unit tests, written in nunit 3 using the nunit 3 NUnit3TestAdapter it starts running the tests. The error it gives is: Error: Illegal characters in path. The complete output as follows 2016-02-11T17:02:40.8514411Z Executing the powershell script: C:\BuildAgent\tasks\VSTest\1.0.29\VSTest.ps1 2016-02-11T17:02:41.1483135Z ##[debug]Calling Invoke-VSTest for all test assemblies 2016-02-11T17:02:41.2108131Z Working