title: Help me understand what is happening with this FAIL in my unit test
body: <p>I have a method that serializes a collection to a file using the XmlSerializer. </p>
  
  <pre><code>    public void Save(List&lt;RetryAttempt&gt; retryAttempts)
      {
          FileStream fs = new FileStream(this.fileName, FileMode.Create);
  
          try
          {
              XmlSerializer xmlSerializer = new XmlSerializer(typeof(List&lt;RetryAttempt&gt;));
              xmlSerializer.Serialize(fs, retryAttempts);
          }
          catch (Exception ex)
          {
              LocalLogger.LogError("Unable to save retry information to xml file.", ex.ToString());
          }
          finally
          {
              fs.Close();
          }
      }
  </code></pre>
  
  <p>I then have another method that deserializes the collection back from the file</p>
  
  <pre><code>    public List&lt;RetryAttempt&gt; GetRetryAttempts()
      {
          List&lt;RetryAttempt&gt; retryAttempts = new List&lt;RetryAttempt&gt;();
  
          if (File.Exists(this.fileName))
          {
              FileStream fs = new FileStream(this.fileName, FileMode.Open);
  
              try
              {
                  XmlSerializer xmlSerializer = new XmlSerializer(typeof(List&lt;RetryAttempt&gt;));
                  retryAttempts = (List&lt;RetryAttempt&gt;)xmlSerializer.Deserialize(fs);
              }
              catch (Exception ex)
              {
                  LocalLogger.LogError("Unable to read from retry xml file.", ex.ToString());
              }
              finally
              {
                  fs.Close();
              }
          }
  
          return retryAttempts;
      }
  </code></pre>
  
  <p>So far so good (unless anyone spots something glaringly wrong with that code...). However, my unit test for this now fails</p>
  
  <pre><code>    [Test]
      public void GetRetryAttempts_AttemptsExist_ListOfAttemptsReturned()
      {
          this.attempt = new RetryAttempt("1234", 4);
          this.attempts = new List&lt;RetryAttempt&gt;() { attempt };
          this.xmlStore = new XmlRetryFileStore(RetryType.Download);
          xmlStore.Save(attempts);
  
          List&lt;RetryAttempt&gt; savedAttempts = xmlStore.GetRetryAttempts();
          Assert.Contains(attempt, savedAttempts);
      }
  </code></pre>
  
  <p>I would expect the list of my custom object to contain the "attempt" that I serialized to the file. Instead I am getting the following failure. </p>
  
  <p><em>Expected: collection containing &lt; MyNamespace.RetryManagement.RetryAttempt >
    But was:  &lt; MyNamespace.RetryManagement.RetryAttempt ></em></p>
  
  <p>This message seems to suggest that instead of a collection being returned, just one object was returned. This is obviously not the case - there is a List being returned that only contains one element - I can see the collection in the immediate window and everything looks fine. I can run the test with the debugger and everything seems okay. If I simply create a collection and assert that it contains the element without saving and getting it from XML then it works fine so the point of failure must be around the serialization? </p>