public void TestSplitByShovel_OneShovelAtFront_OneList() { var p = new PiecesQueue { new Piece(PieceType.Shovel, Color.None, Color.None), new Piece(PieceType.Flower, Color.Blue, Color.Pink), //0 new Piece(PieceType.Flower, Color.Blue, Color.Red), //1 new Piece(PieceType.Flower, Color.Yellow, Color.Red) //2 }; var splitQueue = p.SplitByShovel(); Assert.That(splitQueue.Count == 1); TestHelper(splitQueue[0][0], PieceType.Flower, Color.Blue, Color.Pink); TestHelper(splitQueue[0][1], PieceType.Flower, Color.Blue, Color.Red); TestHelper(splitQueue[0][2], PieceType.Flower, Color.Yellow, Color.Red); }
public void TestSplitByShovel_OneShovel_TwoLists() { var p = new PiecesQueue { new Piece(PieceType.Flower, Color.Blue, Color.Pink), //0 new Piece(PieceType.Flower, Color.Blue, Color.Red), //1 new Piece(PieceType.Flower, Color.Yellow, Color.Red), //2 new Piece(PieceType.Shovel, Color.None, Color.None), //3 new Piece(PieceType.Flower, Color.Pink, Color.Cyan), //4 new Piece(PieceType.Flower, Color.Cyan, Color.White), //5 }; var splitQueue = p.SplitByShovel(); Assert.That(splitQueue.Count == 2); Assert.That(splitQueue[0].Count == 3); Assert.That(splitQueue[1].Count == 2); TestHelper(splitQueue[0][0], PieceType.Flower, Color.Blue, Color.Pink); TestHelper(splitQueue[0][1], PieceType.Flower, Color.Blue, Color.Red); TestHelper(splitQueue[0][2], PieceType.Flower, Color.Yellow, Color.Red); TestHelper(splitQueue[1][0], PieceType.Flower, Color.Pink, Color.Cyan); TestHelper(splitQueue[1][1], PieceType.Flower, Color.Cyan, Color.White); }