nunit-3.0

NUnit: How to pass TestCaseData from a non-static method?

≯℡__Kan透↙ 提交于 2021-02-18 05:02:48
问题 my test fails because of : 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 Qv_ges_Quer; [SetUp] public void init() { qv_ges_NE = Din1946.Calc_Qv_ges_NE(205.7d); Sum_Qv_ges_R_FL = 15d + 15d + 15d + 15d + 15d + 10d + 10d + 10d + 10d + 10d + 10d + 10d; Qv_ges_Quer = Din1946.Calc_Qv_ges_Quer(qv_ges_NE, Sum_Qv_ges_R_FL); } public

How do I install NUnit 3 console on Windows and run tests?

拜拜、爱过 提交于 2021-02-05 20:18:36
问题 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 complete zero. Following it gets me nowhere: https://github.com/nunit/docs/wiki/Installation 回答1: It is hard to find, because there is a lot of outdated documentation, either for NUnit2 or NUnit3. Steps: Official NUnit3 console installers are here:

How do I install NUnit 3 console on Windows and run tests?

喜你入骨 提交于 2021-02-05 20:17:50
问题 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 complete zero. Following it gets me nowhere: https://github.com/nunit/docs/wiki/Installation 回答1: It is hard to find, because there is a lot of outdated documentation, either for NUnit2 or NUnit3. Steps: Official NUnit3 console installers are here:

NUnit 3: Forbid tests to run in parallel

主宰稳场 提交于 2020-06-09 10:03:32
问题 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 thread-dependent and it seems I can't do anything to force NUnit to run my tests sequentially. I've read the documentation and it states that by default tests aren't run in parallel but in fact they are! Moreover, I've tried to add the following attribute:

How to use test suite in NUnit 3

江枫思渺然 提交于 2020-02-24 07:50:30
问题 I'm using NUnit 3 and having problems using test suites. I saw this Documentation page, but it's for the old version and I can't find anything in the new documentation. This does not work, because [Suite] is invalid. [Suite] public static IEnumerable Suite { get { ArrayList suite = new ArrayList(); suite.Add(typeof(OneTestCase)); suite.Add(typeof(AssemblyTests)); suite.Add(typeof(NoNamespaceTestFixture)); return suite; } 回答1: The SuiteAttribute has been removed from NUnit 3 (see the

Fetch Params from Nunit3 in C# test fixture

こ雲淡風輕ζ 提交于 2020-01-15 06:44:43
问题 I am using the params argument provided in the Nunit3 version to pass multiple parameters. However, I am unable to fetch them with the C# test fixture. I have searched but unable to get a correct result. Can someone provide me with the pointers on how to fetch those param arguments in c#. Any help will be appreciated. Thanks in advance. 回答1: First, make sure that you are using both NUnit console 3.4.1 and NUnit Framework 3.4.1. Your command line option of --params:Code=XXX --params:Date=2011

How to output results of tests ran with NUnit 3?

梦想与她 提交于 2020-01-04 09:14:32
问题 Since yesterday I am trying to figure out how to create that xml report that NUnit3 can produce and I just can't find a single example with code, could anyone tell me what should I do in order to make NUnit3 produce the results file or what and where I should be looking for? Thanks! 回答1: This can definitely be done using nunit3-console.exe to run your project. From cmd/powershell call \path\to\nunit3-console.exe \path\to\your.dll . A TestResult.xml file is created in \myProjectFolder\bin

How to run NUnit Runner in Atlassian Bamboo with NUnit 3?

≡放荡痞女 提交于 2019-12-30 06:26:25
问题 I used NUnit Runner in Atlassian Bamboo (latest version) with NUnit 2 but after upgrading to NUnit 3 it is no longer working. It appears something changed with the command line in NUnit 3. Anyone know how to make NUnit 3 work in Atlassian Bamboo? Or could the NUnit devs consider backward compatibility for this breaking change? I get the following error: Invalid argument: -xml=TestResults-Rev_02f5436a0a70cd539bd3b77218fb48cbe3262954-Build_12.xml 回答1: The simplest solution is to create a bat

Typemock not integerating with VS2017 and NUnit3

寵の児 提交于 2019-12-23 19:00:15
问题 Trying to debug tests that use TypeMock and I get the following error: TypeMock.TypeMockException: ' *** Typemock Isolator is currently disabled. Enable using the following: * Within Visual Studio: - Use Typemock Smart Runner - For other runners, Choose Typemock Menu and click "Integrate with Other Runners" * To run Typemock Isolator as part of an automated process you can: - run tests via TMockRunner.exe command line tool - use 'TypeMockStart' tasks for MSBuild or NAnt For more information

Visual Studio Team Services - Run Functional Tests build task aborting after attempting test run

那年仲夏 提交于 2019-12-23 05:01:29
问题 When I attempt to use the Run Functional Tests task after successfully executing the Visual Studio Test Agent Deployment task, the test run is aborting after a period of time with no actionable error reported. 2017-09-18T18:30:56.0416875Z ##[section]Starting: Run Functional Tests 2017-09-18T18:30:56.0436877Z ============================================================================== 2017-09-18T18:30:56.0436877Z Task : Run Functional Tests 2017-09-18T18:30:56.0436877Z Description : Run