jeudi 5 mars 2015

Running NUnit tests on Mono on Windows

I am new to Mono and I would like to be able to run tests on Mono. I created as simple unit test project in Visual Studio 2012 and compiled it against .NET 4.5.



using NUnit.Framework;
namespace ClassLibrary2.Tests
{
[TestFixture]
public class Class1Tests
{
[Test]
public void MyTest()
{
var a = "andsdsaj";
var b = "fjkfjkdjfk";

Assert.AreEqual(a, b);
}
}
}


Then I try to execute it from the Mono Command Prompt:



C:\Program Files (x86)\Mono>nunit-console "C:\Users\boris.m\Documents\Visual Studio 2012\Projects\ClassLibrary2.Tests\bin\Debug\ClassLibrary2.Tests.dll"


I am getting the following error:



C:\Program Files (x86)\Mono>nunit-console "C:\Users\boris.m\Documents\Visual Stu
dio 2012\Projects\ClassLibrary2.Tests\bin\Debug\ClassLibrary2.Tests.dll"
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
OS Version: Microsoft Windows NT 6.1.7601.65536 Service Pack 1
CLR Version: 2.0.50727.1433 ( 3.12.0 (Visual Studio built mono) )


Unhandled Exception:
System.ArgumentException: path
at System.IO.FileSystemInfo.CheckPath (System.String path) [0x00000] in <filen
ame unknown>:0
at System.IO.DirectoryInfo..ctor (System.String path, Boolean simpleOriginalPa
th) [0x00000] in <filename unknown>:0
at System.IO.DirectoryInfo..ctor (System.String path) [0x00000] in <filename u
nknown>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:.ctor (string)

at NUnit.Util.AddinManager.RegisterAddins () [0x00000] in <filename unknown>:0

at NUnit.Util.AddinManager.InitializeService () [0x00000] in <filename unknown
>:0
at NUnit.Util.ServiceManager.InitializeServices () [0x00000] in <filename unkn
own>:0
at NUnit.ConsoleRunner.Runner.Main (System.String[] args) [0x00000] in <filena
me unknown>:0
at NUnit.ConsoleRunner.Class1.Main (System.String[] args) [0x00000] in <filena
me unknown>:0

Aucun commentaire:

Enregistrer un commentaire