title: Assert.AreEqual failed during unit test
body: <p>I am running the following test for a simple console game project I am working on which is failing with Assert.AreEqual failed.</p>
  
  <pre><code>[TestMethod]
      public void TestMethod1()
      {
          //Arrange
          CommandInterpreter interpreter = new CommandInterpreter(new List&lt;IDungeonObject&gt;());
          CommandAction commandAction = new CommandAction(CommandEnum.GoNorth, null);
          const string north = "Go North";
          var expected = commandAction; 
  
          //Act
          var ogbjecUndertest = interpreter.Translate(north);
  
          //Assert
          Assert.AreEqual(expected, ogbjecUndertest);
  
      }
  </code></pre>
  
  <p>Basically the test passes a string (north in this case) to the Translate(north) method which then calls the following code and returns an Enum depending on the string.</p>
  
  <pre><code>public CommandAction Translate(string issuedCommand) // &lt;-- Go North
      {
          if (issuedCommand.IndexOf(' ') == -1)
              throw new InvalidCommandException("No command entered");
  
          if (issuedCommand.Equals("Go South", StringComparison.OrdinalIgnoreCase))
              return new CommandAction(CommandEnum.GoSouth, null);
  
          if (issuedCommand.Equals("Go North", StringComparison.OrdinalIgnoreCase))
              return new CommandAction(CommandEnum.GoNorth, null);
  
          return null;
  </code></pre>
  
  <p>The method takes in the CommandAction class of</p>
  
  <pre><code> public class CommandAction
  {
     #region Properites
  
     /// &lt;summary&gt;
     /// Defines a valid commands
     /// &lt;/summary&gt;
     public CommandEnum Command { get; private set; }
  
     /// &lt;summary&gt;
     /// Defines a dungeon object
     /// &lt;/summary&gt;
     public IDungeonObject RelatedObject { get; private set; }
  
     #endregion
  
     #region Constructor
  
     /// &lt;summary&gt;
     /// User input action passed in by the dugeon controller 
     /// &lt;/summary&gt;
     /// &lt;param name="command"&gt;&lt;/param&gt;
     /// &lt;param name="dungeonObject"&gt;&lt;/param&gt;
     public CommandAction(CommandEnum command, IDungeonObject dungeonObject)
     {
         Command = command;
         RelatedObject = dungeonObject;
     }
  
     #endregion
  </code></pre>
  
  <p>}</p>
  
  <p>When I debug the test the Assert expected shows my 2 CommandAction properties as; Command: GoNorth and RelatedObject null</p>
  
  <p>And my object under test shows as; Command: GoNorth and RelatedObject: null</p>
  
  <p>So my values look correct but I dont know why the test failing?</p>