public void Drop_EnoughSpace_BoardWithLine() { //arange IBoard board = new TestBoard(createBoardWithLineHor()); IShape shape = new ShapeI(board); //act shape.Drop(); int x = shape[0].Position.X; int y = shape[0].Position.Y; //assert Assert.AreEqual(4, x); //expected, actual Assert.AreEqual(8, y); }
public void Drop_NoSpace_EmptyBoard() { //arange IBoard board = new TestBoard(createEmptyBoard(10, 1)); IShape shape = new ShapeI(board); //act shape.Drop(); int x = shape[0].Position.X; int y = shape[0].Position.Y; //assert Assert.AreEqual(4, x); //expected, actual Assert.AreEqual(0, y); }
public void Move_OnJoinPile() { //arange IBoard board = new TestBoard(createEmptyBoard(10, 10)); IShape shape = new ShapeI(board); bool eventJoin = false; shape.JoinPile += () => eventJoin = true; //act shape.Drop(); //assert Assert.IsTrue(eventJoin); }