nunit

how to specify the platform (android or ios) test with nunit console

自作多情 提交于 2019-12-11 14:05:01
问题 I have a xamarin ui test multiplateform project, I would like to know if I launch my test via the console it is possible to launch only ios or android tests. For if it launches the two ... my current command line is : mono /Users/Shared/opt/NUnit/nunit3-console.exe /Users/Shared/Jenkins/Home/workspace/build_project/UITest/bin/Debug/UITest.dll Thank's for your help 回答1: I find the solution, I need to add --test="UITest.Tests(my_platform)" to select either iOS or Android! 来源: https:/

NUnit not looking the file in the right folder

送分小仙女□ 提交于 2019-12-11 13:38:54
问题 I just updated nUnit from 2.6.4 to 3.0.1 on my VS2015. Everything went well with just ONE problem. In my Test method, I have to load a xml file, let's call it UnitTestConfiguration.xml , it is saved inside the same root folder as the app.Config and package.Config file. With NUnit 2.6.4, this xml file is being found and load perfectly. But, with Nunit 3.0.1, I receive this error: System.IO.FileNotFoundException : Could not find file 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7

System.ComponentModel.Win32Exception when executing F# Nunit unit test code with Mono

会有一股神秘感。 提交于 2019-12-11 13:05:52
问题 I'm trying to use F# unittest on Mono. I use Mac OS X. I downloaded and copied NUNit frameworks. I have the following environments nunitFramework=.../bin/mono/NUnit.2.6.4/nunit.framework.dll console=.../bin/mono/NUnit.2.6.4/nunit-console.exe fsUnit=.../bin/mono/NUnit.2.6.4/FsUnit.NUnit.dll This is F# code: namespace HelloWorld.Core module Hello = let SayHello name = "Hello" This is the unittest for it. module HelloWorld.Tests.Hello open HelloWorld.Core.Hello open NUnit.Framework open FsUnit [

The test method is not being shown in test explorer VS2013

我是研究僧i 提交于 2019-12-11 12:31:27
问题 I'm at the beginning of testing a calculation method. I did clean, rebuild, x64 adjustments to the project and I have nunit test adapter and other related dlls yet I still cannot see the test method in test explorer pane. Could someone help, is there something missing about the code or what? namespace Ninja.Tests { [TestFixture] public class SinglePricingTests { [Test] public void ShouldCalculate() { var pricingModelTest = new PricingModel(); var Sut = new PriceCalculationService(); // Sut:

Nunit .net vs mono

若如初见. 提交于 2019-12-11 12:30:00
问题 I have written a simple test application using asp.net mvc with C#. The application uses MySQL by using dblinq to generate linq to MySQL files and the application is working both in windows and linux. I have now started to use NUnit to test my code, mostly since I need to test if the code working under windows also will work in linux. My NUnit tests runs well under Windows but not under Linux. This my Windows environment: NUnit version 2.5.1.9189 Copyright (C) 2002-2009 Charlie Poole.

How to write a NUnit test for an NUnit add-in?

情到浓时终转凉″ 提交于 2019-12-11 12:29:34
问题 I'm working on a variation of this stack overflow answer that provides reliable cleanup of tests. How do you write unit tests for NUnit addins? Examining how NUnit self tests, I have determined: You can write tests, that pass, that verify correct behavior of NUnit for failing tests. You write unit tests against test fixtures in a separate assembly (otherwise the fixtures under test will execute with your unit tests) Use NUnit.TestUtilities.TestBuilder to create fixtures and call TestSuite.Run

VSTESTcode coverage broken after SP1 for Visual Studio 2015 installed

天涯浪子 提交于 2019-12-11 12:18:25
问题 This worked before SP1 was installed. namespace Test { public class Adder { public int Add(int n1, int n2) { return n1 + n2; } } } namespace AdderTest { [TestFixture] public class Class1 { [Test] public void AddTest1() { var add = new Adder(); var res = add.Add(2, 3); Assert.AreEqual(5, res); } } } This command still works after SP1 installed vstest.console.exe /usevsixextensions:true /framework:framework45 /platform:x86 AdderTest.dll This one doesn't and it fails on every PC in our team

Can't overload async/await methods with NUnit Test Adapter

徘徊边缘 提交于 2019-12-11 11:59:56
问题 I'm getting a System.Reflection.AmbiguousMatchException when at least one of the methods are async and the method names match when the NUnit tests are run using the NUnit Test Adapter 2.0.0.0 in Visual Studio. I'm able to run the tests without problem when I use the ReSharper unit test runner and when I use the NUnit GUI test runner ( NUnit-2.6.4.msi ). Is this a bug in the NUnit Test Adapter? [TestFixture] public class SimpleRepro { [Test] [TestCase("I'm valid")] [TestCase("So am I!")]

NUnit 2.6.2 TestContext.CurrentContext always null

喜你入骨 提交于 2019-12-11 11:47:58
问题 I'm trying to use the TestContext.CurrentContext of NUnit 2.6.2 but it's always null. What I would like is to have an output with the result of tests, but if I run the following code I always get a NullReferenceException in the TearDown method. All the properties inside Test and Result are throwing the exception. [TestFixture] public class UtilitiesTests { [TearDown] public void TearDown() { //using console here just for sake of simplicity. Console.WriteLine(String.Format("{0}: {1}",

Integration testing using Selenium and NUnit - From UI to DB

隐身守侯 提交于 2019-12-11 11:35:10
问题 I am having some problems while trying to create integration tests with Selenium and NUnit. I'm trying to use Selenium RC in NUnit test to drive my ASP.NET web app, and would like the tests to actually do all the stuff in DB that the real user would do. Naturally it would be nice if the database could get rolled back after Selenium has done it's thing, and i've asserted that db contains the new rows (etc) with the data from the ui. So, here's the setup i have (in some sort of pseudocode):