public void TestCreateObjects()
        {
            IFactory balloonFactory = new BalloonFactory();

            var balloons = balloonFactory.CreateObjects();

            bool containsOnlyBalloons = true;

            foreach (var renderableObject in balloons)
            {
                if (!(renderableObject is Balloon))
                {
                    containsOnlyBalloons = false;
                    break;
                }
            }

            bool actual = containsOnlyBalloons;
            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        private void setLevel()
        {
            this.level = Level;

            this.balloons = new BalloonFactory(this.Content, this.level);
        }
 // Flyweight
 /// <summary>
 /// Initializes a new instance of the <see cref="Board"/> class.
 /// </summary>
 /// <param name="rows">Count of board rows.</param>
 /// <param name="columns">Count of board columns.</param>
 public Board(byte rows, byte columns)
 {
     this.rows = rows;
     this.columns = columns;
     this.balloonFactory = new BalloonFactory();
 }