Note that there are some explanatory texts on larger screens.

plurals
  1. POCollectionAssert.AreEqual failed. (Element at index 0 do not match.)
    primarykey
    data
    text
    <p>I cant seem to find out why I am getting this error as the <code>actual</code> and <code>expected</code> are returning the same values at index 0 and have exactly the same properties. what could be the possible cause of this problem? I've looked around but cant find any viable solution as of yet.</p> <pre><code>[TestMethod()] public void unSortedLeadsTest() { List&lt;CustomerLead&gt; expected = new List&lt;CustomerLead&gt;(); List&lt;CustomerLead&gt; actual = new List&lt;CustomerLead&gt;(); CustomerLeads target = new CustomerLeads(); // TODO: Initialize to an appropriate value string xml = "C:/Users/Admin/Downloads/potentialcustomers.xml"; // TODO: Initialize to an appropriate value actual = target.unSortedLeads(xml); CustomerLead lead = new CustomerLead() { FirstName = actual[0].FirstName, LastName=actual[0].LastName, EmailAddress=actual[0].EmailAddress }; CustomerLead lead1 = new CustomerLead() { FirstName = actual[1].FirstName, LastName = actual[1].LastName, EmailAddress = actual[1].EmailAddress }; CustomerLead lead2 = new CustomerLead() { FirstName = actual[2].FirstName, LastName = actual[2].LastName, EmailAddress = actual[2].EmailAddress }; target.addressList.Add(lead); target.addressList.Add(lead1); target.addressList.Add(lead2); foreach (CustomerLead i in target.addressList) { expected.Add(lead); } // TODO: Initialize to an appropriate value CollectionAssert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); } </code></pre> <p><strong>Edit:</strong> Ive attempted to override Equals but am struggling: any Ideas how I might acheive this?</p> <pre><code>public override bool Equals(Object obj) { if (obj == null) return false; CustomerLead leadsequal = obj as CustomerLead; if ((Object)leadsequal == null) return false; else return Equals( leadsequal); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload