nunit-console

Running tests on Mac OS X console using mono/nunit-console/4

五迷三道 提交于 2019-12-04 02:50:38
I have Max OS X 10.11.1 installed, with Xamarin on it. I wrote simple testing class, just to test running Nunit tests on Mac OS X & Ubuntu, class has literally one method which returns string: using System; namespace testing_project { public class EmptyClass { public EmptyClass () { } static void Main(string[] args) { } public string helloWorld() { return "Hello World!"; } } } And I have a NUnit class to test my EmptyClass: using System; using NUnit.Framework; namespace testing_project { [TestFixture] public class EmptyClassTest { [Test] public void testHelloWorld() { EmptyClass empty = new

pass test case parameters using nunit console

天涯浪子 提交于 2019-12-03 09:02:48
问题 I am developing tests using Nunit and data driven testing approach. I have test method with 2 parameters: path to xlsx file and worksheet name. It works perfect in Visual Studio when I pass parameters in TestCase attribute, for example when I want to run 3 test cases have to write something like this: [TestCase(@"pathToFile.xlsx", "TestCase1")] [TestCase(@"pathToFile.xlsx", "TestCase2")] [TestCase(@"pathToFile.xlsx", "TestCase3")] public void performActionsByWorksheet(string excelFilePath,

pass test case parameters using nunit console

一曲冷凌霜 提交于 2019-12-02 23:09:44
I am developing tests using Nunit and data driven testing approach. I have test method with 2 parameters: path to xlsx file and worksheet name. It works perfect in Visual Studio when I pass parameters in TestCase attribute, for example when I want to run 3 test cases have to write something like this: [TestCase(@"pathToFile.xlsx", "TestCase1")] [TestCase(@"pathToFile.xlsx", "TestCase2")] [TestCase(@"pathToFile.xlsx", "TestCase3")] public void performActionsByWorksheet(string excelFilePath, string worksheetName) { //test code } I would like to run my test cases and pass parameters using Nunit

How to run nunit with msbuild from VS2010

你。 提交于 2019-12-02 19:12:06
please tell me how to run nunit with msbuild. I am using TFS for code integration and VS2010 . You probably want to integrate NUnit with TFSBuild and not MSBuild since you are using Team Foundation Server. You will need MSBuild tasks to be able to run NUnit as explained in the three following tutorials: Using NUnit and NCover with TFS Build Integrate Nunit test into a Tfs build MSBuild with NUnit The easiest way is to use the MSBuild Community Tasks where you already have a NUnit task ready to be used and you only will need to add a target to your msbuild file like so: <Target Name="RunTests">

Pass parameters via command line to NUnit

北城余情 提交于 2019-11-28 21:09:27
Is it somehow possible to pass values to NUnit tests via command line? My tests use a certain URL. I have different instances of my code at different URLs and would like to specify the URL via command line. App.config is not an option, because I want to run the tests for different URLs via a batch file. Environment variable. Use set from the command-line or <setenv> from nant. Then read the value using Environment.GetEnvironmentVariable() . There seems to be no solution at the moment. Best option is to use NUnit project files, modify settings there and pass the solution file to the runner. I