title: How do I correctly work with C# automated test AreEqual?
body: <p>I'm workin on some automated test for a C# project but I'm having some problem to make the test pass when it should on big classes. All of the test that cover the specific parameters passes but the main one does not. If I write a custom MainMemento Equals method and manually put every parameter in it the test pass but it's not an elegant solution.</p>
  <pre><code>[Test]
  public void TestMainMementoComparison() {
      Tuple&lt;MainMemento, MainMemento&gt; data = SaveLoad();
      Assert.AreEqual(data.Item1, data.Item2);
  }
  [Serializable]
  public class MainMemento {
      public StateMemento StateMap { get; set; }
      public DepartmentEffectsMemento DepartmentEffects { get; set; }
      public GeneralDatabaseMemento&lt;DocumentInstanceID, DocumentInstance&gt; DocumentDB { get; set; }
      public GeneralDatabaseMemento&lt;BuildingID, Building&gt; BuildingDB { get; set; }
      public GeneralDatabaseMemento&lt;CityActionID, CityAction&gt; CityActionDB { get; set; }
      public int PlayerWeekToSkip { get; set; }
      public DocumentsHandlerMemento DocumentsHandler { get; set; }
      public List&lt;KeyValuePair&lt;GameLaws.Law, LawStatus&gt;&gt; Laws { get; set; }
      public Boolean SimulationState { get; set; }
      public Session.Settings Settings { get; set; }
      public ElementsPoolMemento&lt;SaveableSprite&gt; portraitPool { get; set; }
      public override bool Equals(object obj) {
          if (obj == null || GetType() != obj.GetType()) {
              return false;
          }
          MainMemento other = (MainMemento)obj;
          if (!StateMap.Equals(other.StateMap))
              return false;
          if (!DepartmentEffects.Equals(other.DepartmentEffects))
              return false;
          if (!BuildingDB.Equals(other.BuildingDB))
              return false;
          if (!CityActionDB.Equals(other.CityActionDB))
              return false;
          if (!PlayerWeekToSkip.Equals(other.PlayerWeekToSkip))
              return false;
          if (!DocumentsHandler.Equals(other.DocumentsHandler))
              return false;
          if (!GameUtils.AreEqual&lt;KeyValuePair&lt;GameLaws.Law, LawStatus&gt;&gt;(Laws, other.Laws))
              return false;
          if (!SimulationState.Equals(other.SimulationState))
              return false;
          if (!Settings.Equals(other.Settings))
              return false;
          if (!portraitPool.Equals(other.portraitPool))
              return false;
          return true;
      }
      public override int GetHashCode() { return base.GetHashCode(); }
  }
  </code></pre>