public void TestClearLevelNotEmpty() { PlayField field = new PlayField(5, 5, 20); field.MakeChangesToField(0, 0); bool allBubblesPopped = field.ClearedLevel(); Assert.AreEqual(false, allBubblesPopped); }
public void TestClearLevelEmpty() { PlayField field = new PlayField(5, 5, 1); field.MakeChangesToField(2, 2); bool allBubblesPopped = field.ClearedLevel(); Assert.AreEqual(true, allBubblesPopped); }
public void TestCheckIfPoppableBallonsNotPoppable() { PlayField field = new PlayField(3, 3, 1); field.MakeChangesToField(1, 1); CommandParser parser = new CommandParser(); int countPopped=0; for (int i = 0; i < field.GetLength(0); i++) { for (int j = 0; j < field.GetLength(1); j++) { if (!parser.CheckPoppableBalloon( i.ToString()+" "+j.ToString(), field)) { countPopped++; } } } Assert.AreEqual(9, countPopped); }
public void TestMakeChangesToField() { PlayField field= new PlayField(5,5,1); field.MakeChangesToField(2,2); bool allBubblesPopped = true; for (int i = 0; i < field.GetLength(0); i++) { for (int j = 0; j < field.GetLength(1); j++) { if (field[i,j]!=0) { allBubblesPopped=false; break; } } } Assert.AreEqual(true, allBubblesPopped); }