Why my Validate.IsTrue() method says that two lists are actually different (Validation is failed, Condition is not true.)?

Viewed 27

I am trying to validate if two of my lists are the same, but with no success. There are just two members of the list. Also, I was trying to write some methods to drag and drop pictures inside container (to change the sequence), so first image became the second one and vice versa, but same thing happens (and creepier thing is that makes sense). I commented that part as well.

What I am doing is:

public void VerifyDragIndicatorAndDeleteButton(Ranorex.SectionTag imageList) 
{ 
   List<ImgTag> mediaList = new List<ImgTag>(); 
   IList<ImgTag> list = imageList.Find<ImgTag>(".//img[@style='max-width: 60px; max-height: 60px;']"); 

   foreach (ImgTag pic in list) 
   { 
      mediaList.Add(pic); 
   } 

   /*Repo.DragAndDropIndicatorInfo.CreateAdapter<Unknown>(false).MoveTo("5;6");       
    Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
    Repo.DragAndDropIndicatorInfo.CreateAdapter<Unknown>(false).MoveTo("8;214");
    Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left); */

    List<ImgTag> secondMediaList = new List<ImgTag>(); 
    IList<ImgTag> secondList = imageList.Find<ImgTag>(".//img[@style='max-width: 60px; max-height: 60px;']");  

    foreach (ImgTag pic in secondList) 
    { 
       secondMediaList.Add(pic); 
    } 

    var isEqual = secondMediaList.SequenceEqual(mediaList);   
    Validate.IsTrue(isEqual);
}

Obviously, they're the same lists with the same members and sequence. My question is: Why my output says this:

Condition is not true.

?

0 Answers
Related