Example #1
0
		public void LoseConditionIsNotMet()
		{
			Board target = new Board();
			bool actual = target.IsLoseConditionMet();

			Assert.IsFalse(actual);
		}
Example #2
0
		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;
		}
Example #3
0
		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);
		}
Example #4
0
		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);
		}