title: NUnit doesn't work well with Assert.AreEqual
body: <p>I'm new to unit testing and NUit in particular.
  I'm just typing some examples from the book which refers to Java and JUnit. But I'm using C# instead.</p>
  
  <p>The problem is: I've got a class with overriden methods such as <code>Equals()</code> and <code>GetHashCode()</code>, but when I am trying to compare two objects of this class with <code>Assert.AreEqual()</code> my code is not called, so I get an exception.</p>
  
  <p><code>Assert.True(MyClass.Equals(MyClass2))</code> does work well. But I don't want to use this construction instead of <code>Assert.AreEqual()</code>. Where can the problem be?</p>
  
  <p>Here is the class:</p>
  
  <pre><code>public class Money
  {
      public int amount;
      protected string currency;
  
      public Money(int amount, string currency)
      {
          this.amount = amount;
          this.currency = currency;
      }
  
      public new bool Equals(object obj)
      {
          if (obj == null)
              return false;
  
          Money money = (Money)obj;
          return (amount == money.amount)
                  &amp;&amp; (Currency().Equals(money.Currency()));
      }
  
      public new int GetHashCode()
      {
          return (string.Format("{0}{1}", amount, currency)).GetHashCode();
      }
  
      public static Money Dollar(int amount)
      {
          return new Money(amount, "USD");
      }
      public static Money Franc(int amount)
      {
          return new Money(amount, "CHF");
      }
  
      public Money Times(int multiplier)
      {
          return new Money(amount * multiplier, currency);
      }
  
      public string Currency()
      {
          return currency;
      }
  }
  </code></pre>
  
  <p>And the test method itself:</p>
  
  <pre><code>[TestFixture]
  public class DollarTest
  {
      [Test]
      public void TestMultiplication()
      {
          Money five = Money.Dollar(5);
          Assert.True(Money.Dollar(10).Equals(five.Times(2)));  // ok
          Assert.AreEqual(Money.Dollar(10), five.Times(2));     // fails
      }
  }
  </code></pre>