I have the following unit test:
string MtrlCode = \"0\";
Assessment target = new Assessment(MtrlCode);
List EdgeCaseSymbolCodes = new List<
If you want to compare to List you can create a void function with that code Snippet.
Assert.AreEqual(response.Count, acceptedResponse.Count,"Diferent list length");
for (int i = 0; i < acceptedResponse.Count; i++)
{
Assert.AreEqual(response[i],acceptedResponse[i]);
}
The Assert
fails because it verifies whether the two lists are in fact the same instance. They are not; it's two different list instances. You will need to write code to verify that the two lists contains the same set of items.
I am also faced(ing) the same problem. As a work around you can check the count of the list, and do a for each and check for contains.
Use CollectionAssert.AreEqual()
.