コード例 #1
0
ファイル: BoardTest.cs プロジェクト: Hitchhikrr/tetris-attack
		public void LoseConditionIsNotMet()
		{
			Board target = new Board();
			bool actual = target.IsLoseConditionMet();

			Assert.IsFalse(actual);
		}
コード例 #2
0
ファイル: Board.cs プロジェクト: Hitchhikrr/tetris-attack
		public static Board BuildNewBoard()
		{
			int numberOfBlocksInTheList = 3;
			var blockLists = new System.Collections.Generic.List<System.Collections.Generic.LinkedList<Block>>();

			for (int counter = 0; counter < maxNumberOfLists; counter++)
			{
				var linkedList = new System.Collections.Generic.LinkedList<Block>();

				for (int listCounter = 0; listCounter < numberOfBlocksInTheList; listCounter++)
				{
					var block = GetNewRandomBlock();
					linkedList.AddFirst(block);
				}

				blockLists.Add(linkedList);
			}

			Board board = new Board()
			{
				BlockLists = blockLists
			};

			return board;
		}
コード例 #3
0
ファイル: BoardTest.cs プロジェクト: Hitchhikrr/tetris-attack
		public void LoseConditionIsMet()
		{
			var blockLists = new System.Collections.Generic.List<System.Collections.Generic.LinkedList<Block>>();

			for (int counter = 0; counter < 6; counter++)
			{
				var linkedList = new System.Collections.Generic.LinkedList<Block>();

				for (int listCounter = 0; listCounter < 14; listCounter++)
				{
					linkedList.AddFirst(new Block());
				}
					
				blockLists.Add(linkedList);
			}
				
			Board target = new Board()
			{
				BlockLists = blockLists
			};

			bool actual = target.IsLoseConditionMet();

			Assert.IsTrue(actual);
		}
コード例 #4
0
ファイル: BoardTest.cs プロジェクト: Hitchhikrr/tetris-attack
		public void PushBlocksTest()
		{
			int numberOfBlocksInTheList = 10;
			var blockLists = new System.Collections.Generic.List<System.Collections.Generic.LinkedList<Block>>();

			for (int counter = 0; counter < 6; counter++)
			{
				var linkedList = new System.Collections.Generic.LinkedList<Block>();

				for (int listCounter = 0; listCounter < numberOfBlocksInTheList; listCounter++)
				{
					linkedList.AddFirst(new Block());
				}

				blockLists.Add(linkedList);
			}

			Board target = new Board()
			{
				BlockLists = blockLists
			};

			target.PushBlocks();

			Assert.AreEqual(++numberOfBlocksInTheList, target.BlockLists[0].Count);
		}