title: How to compile and run C# files with NUnit tests from the command line on a Mac, using mono
body: <p>I have two files. One is my test file, Tests.cs:</p>
  
  <pre><code>using NUnit.Framework;
  
  [TestFixture]
  public class HelloTest
  {
      [Test]
      public void Stating_something ()
      {
          Assert.That(Greeter.Hello(), Is.EqualTo("Hello world."));
      }
  }
  </code></pre>
  
  <p>The other is Greeter.cs:</p>
  
  <pre><code>public class Greeter
  {
      public static string Hello(string statement)
      {
          return "Hello world.";
      }
  }
  </code></pre>
  
  <p>How do I run these from the command line on a Mac?</p>
  
  <p>For a simple script, I can run:</p>
  
  <pre><code>mcs -out:Script.exe Script.cs
  mono Script.exe
  </code></pre>
  
  <p>But when I try to run mcs -out:Tests.exe Tests.cs, I get an error: error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?</p>
  
  <p>And if that were fixed, the Tests file isn't referencing the Greeter file anyway, so how do I make it find it?</p>