private bool CompareTileLists(List <Tile> list1, List <Tile> list2) { bool areEqual = true; if (list1.Count != list2.Count) { return(false); } foreach (Tile item in list1) { Tile tile1 = item; Tile tile2 = list2.ElementAt(list1.IndexOf(item)); if (0 != tile1.CompareTo(tile2)) { areEqual = false; } if (!tile1.Label.Equals(tile2.Label)) { areEqual = false; } } return(areEqual); }
public void Test2CompareTo() { Tile tile1 = new Tile("7", 12); Tile tile2 = new Tile("3", 8); Assert.AreEqual(1, tile1.CompareTo(tile2)); }