public void TestGenerateSmallBlueBubble() { RandomStrategy generateBubble = new RandomStrategy(); Field field = new Field(10, 10); Cell bubble = generateBubble.GenerateBubble(field, BubbleSize.Small, BubbleColor.Blue); Assert.IsNotNull(bubble); Assert.AreEqual(BubbleSize.Small, bubble.Contain); Assert.AreEqual(BubbleColor.Blue, bubble.Color); Assert.IsTrue(bubble.Row >= 0); Assert.IsTrue(bubble.Row <= field.Height - 1); Assert.IsTrue(bubble.Column >= 0); Assert.IsTrue(bubble.Column <= field.Width - 1); }
public void TestGenerationFailed() { RandomStrategy generateBubble = new RandomStrategy(); Field field = new Field(10, 10); for (int i = 0; i < field.Height; i++) { for (int j = 0; j < field.Width; j++) { field.Cells[i, j].Contain = BubbleSize.Big; field.Cells[i, j].Color = BubbleColor.Red; field.EmptyCells--; } } Cell bubble = generateBubble.GenerateBubble(field, BubbleSize.Small, BubbleColor.Blue); }