public void CheckBeetleStackCloning() { Ant ant = new Ant(PieceColor.Black, 1); Beetle beetle = new Beetle(PieceColor.Black, 1); Beetle beetle2 = new Beetle(PieceColor.Black, 2); Beetle beetle3 = new Beetle(PieceColor.White, 1); Beetle beetle4 = new Beetle(PieceColor.White, 2); BeetleStack bs = new BeetleStack(beetle3, new BeetleStack(ant, beetle)); BeetleStack bs2 = new BeetleStack(beetle4, bs); Assert.IsFalse(bs.Equals(bs2)); Assert.IsTrue(bs.Contains(beetle3)); Assert.IsTrue(bs2.Contains(beetle3)); }
public void CheckBeetleStackEquality() { Ant ant = new Ant(PieceColor.Black, 1); Beetle beetle = new Beetle(PieceColor.Black, 1); Beetle beetle2 = new Beetle(PieceColor.Black, 2); Beetle beetle3 = new Beetle(PieceColor.White, 1); Beetle beetle4 = new Beetle(PieceColor.White, 2); BeetleStack bs = new BeetleStack(beetle3, new BeetleStack(ant, beetle)); BeetleStack bs2 = new BeetleStack(beetle3, new BeetleStack(ant, beetle)); BeetleStack bs3 = new BeetleStack(ant, beetle4); Assert.IsTrue(bs.Equals(bs2)); Assert.IsFalse(bs3.Equals(bs2)); Assert.IsFalse(bs2.Equals(beetle3)); }