Q:

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

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

[<Test>]
let shouldSayHello () = Assert.AreEqual("Hello World!", SayHello "World")

I compile the code and unittest:
fsharpc --target:library HelloWorld.fs
fsharpc --target:library -r:HelloWorld.dll -r:$nunitFramework -r:$fsUnit HelloWorldTest.fs

I run the test: mono $console HelloWorldTest.dll to get the error messages.
ProcessModel: Default    DomainUsage: Single
Execution Runtime: mono-3.5
Unhandled Exception:
System.ComponentModel.Win32Exception: ApplicationName='mono', CommandLine='--runtime=v4.0.30319 "/Users/smcho/Dropbox/smcho/bin/mono/NUnit.2.6.4/nunit-agent.exe" cc695a32-96df-4346-bfda-e5547d7acc87 tcp://127.0.0.1:58755/TestAgency', CurrentDirectory='', Native error= Cannot find the specified file
  at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
  at NUnit.Util.TestAgency.LaunchAgentProcess (NUnit.Core.RuntimeFramework targetRuntime) [0x00000] in <filename unknown>:0 
  at NUnit.Util.TestAgency.CreateRemoteAgent (NUnit.Core.RuntimeFramework framework, Int32 waitTime) [0x00000] in <filename unknown>:0 
  at NUnit.Util.TestAgency.GetAgent (NUnit.Core.RuntimeFramework framework, Int32 waitTime) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) NUnit.Util.TestAgency:GetAgent (NUnit.Core.RuntimeFramework,int)
  at NUnit.Util.ProcessRunner.Load (NUnit.Core.TestPackage package) [0x00000] in <filename unknown>:0 
  at NUnit.ConsoleRunner.ConsoleUi.Execute (NUnit.ConsoleRunner.ConsoleOptions options) [0x00000] in <filename unknown>:0 
  at NUnit.ConsoleRunner.Runner.Main (System.String[] args) [0x00000] in <filename unknown>:0 

What might be wrong?

A:

I needed multiple changes for solving the issue:
Revised F# test code
I needed to use TestFixture.
module HelloWorld.Tests.Hello

open HelloWorld.Core.Hello
open NUnit.Framework
//open FsUnit

[<TestFixture>]
type TestClass() = 
    [<Test>]
    member tc.When2IsAddedTo2Expect4() = 
        Assert.AreEqual(4, 2+2)

    [<Test>]
    member tc.shouldSayHello () = 
        Assert.AreEqual("Hello", SayHello "World")

Execute mono provided unit-console
I had to execute the unit-console that is symbolically linked to /usr/bin/nunit-console@ -> /Library/Frameworks/Mono.framework/Commands/nunit-console
No need to use external dlls
I didn't have to use FsUnit.NUnit or unit.framework that I downloaded from NUNit website. 
fsharpc --target:library HelloWorld.fs
fsharpc --target:library -r:HelloWorld.dll -r:nunit.framework HelloWorldTest.fs
nunit-console HelloWorldTest.dll

After the changes, everything seems to be working fine:
F# Compiler for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
F# Compiler for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
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: Unix 14.3.0.0
  CLR Version: 2.0.50727.1433 ( 3.12.0 ((detached/a813491 Tue Dec 16 12:19:26 EST 2014) )

..
Tests run: 2, Failures: 0, Not run: 0, Time: 0.034 seconds

References

http://sector0.dk/?p=33
http://www.nunit.org/index.php?p=consoleCommandLine&r=2.2.5

