nunit

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

OpenCover takes much longer to run than the nunit-console

倖福魔咒の 提交于 2020-01-04 09:03:59
问题 I'm trying to add unit tests to this project: https://github.com/JimBobSquarePants/ImageProcessor When running the unit tests, they take maybe 1 or 2 minutes to run (it's an image processing library, and I don't expect them to be insanely fast). The problem is that when I run OpenCover over these tests, they take something like 20 minutes to run. The gist of the current unit tests is that there are a bunch of test images, and each unit test (more like integration tests, actually) reads each

Travis unable to find csharp solution

余生颓废 提交于 2020-01-04 06:50:21
问题 In reference to this build and my ./.travis.yml file. Im unable to build my project using Travis CI. I get the following error: No solution or script defined, exiting Going by csharp.rb:88, it suggests the solution isnt set in my yml file, but it quite clearly is. Any pointers would be greatly appreciated. language: csharp solution: OrderedJobs.sln before_install: - sudo apt-get install nunit-console before_script: - nuget restore OrderedJobs.sln after_script: - nunit-console OrderedJobs

SetUp method failed while running tests from teamcity

强颜欢笑 提交于 2020-01-04 06:14:16
问题 I am successfuly running tests locally via nunit. But when I try to run them through teamcity some tests are passed but some failed by giving the following error. SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6. at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, LogonDialogHandler logonDialogHandler, Boolean

SetUp method failed while running tests from teamcity

无人久伴 提交于 2020-01-04 06:12:27
问题 I am successfuly running tests locally via nunit. But when I try to run them through teamcity some tests are passed but some failed by giving the following error. SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6. at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, LogonDialogHandler logonDialogHandler, Boolean

TestFixtureSetUpAttribute not found in JustMock?

本秂侑毒 提交于 2020-01-04 04:10:19
问题 I'm developing a TDD test with C#, .NET Framework 4.7, Nunit 3.8.0 and JustMock Lite 2017.2.821.1. When I do this: IGenericRepository<ProductionOrder> _proOrdRepository = Mock.Create<IGenericRepository<ProductionOrder>>(); I get the following exception: System.TypeInitializationException occurred HResult=0x80131534 Message=An exception occurred in the type initializer of 'Telerik.JustMock.Core.Context.MockingContext'. Source=Telerik.JustMock StackTrace: at Telerik.JustMock.Core.Context

Is there a good measure of completeness of Unit tests

不打扰是莪最后的温柔 提交于 2020-01-04 02:48:13
问题 I have a class that I need to Unit Test. For background I'm developing in c# and using NUnit, but my question is more theoretical: I don't know if I've written enough test methods and if I checked all the scenarios. Is there a known working method/best practices/collection of rules for that? Something like "check every method in your class ...bla bla " "check all the inserts to DB ...bla bla " (this is a silly example of possible rules but if I had something not silly on my mind I wouldn't

NUnit's TestCaseAttribute equivalent in VS Unit Test Framework

穿精又带淫゛_ 提交于 2020-01-03 19:15:44
问题 Is there an NUnit's TestCaseAttribute equivalent in Visual Studio 2008 unit test framework ? You know, something like this: [TestCase(1, 1, 1)] [TestCase(2, 2, 2)] [TestCase(3, 3, 3)] public void Test1(int a, int b, int c) { // do stuff depending on the TestCase } 回答1: MSTest unfortunately doesn't support parameterized tests in this way. The closest you get is with the DataSource attribute, which allows you to specify an external data source for the test method. 来源: https://stackoverflow.com

How to write Performance Test for .Net application?

旧街凉风 提交于 2020-01-03 17:39:28
问题 How to write Performance Test for .Net application? Does nUnit or any other Testing framework provides framework for this? Edit : I have to measure performance of WCF Service. 回答1: If you are interested in relative performance of methods and algorithms, you can use the System.Diagnostic.StopWatch class in your NUnit tests to write assertions about how long certain methods take. In the simple example below, the primes class is instantiated with a [SetUp] method (not shown), as I'm interested

Correct Way To Run Test Set Up with Nunit TestCaseSource

社会主义新天地 提交于 2020-01-03 15:59:03
问题 I am trying to run multiple tests using TestCaseSource in NUnit. But I am struggling to get the [SetUp] to run when I want it. At the moment it works how I want it to but it doesnt feel "right". So the following is the main test case code (simplified): public class ImportTestCases { ImportTestCases() { TestData.RunTestSetup(); } public static IEnumerable TestCases { get { //run the funciton under test... var results = RunFunctionSubjectToTest(TestData.ImportantVar); //get multiple results...