Пример #1
0
 public void TestScore()
 {
     Diamond diamond = new Diamond(GameBonus.Common);
     Assert.AreEqual(diamond.Score, 2);
     diamond = new Diamond(GameBonus.Average);
     Assert.AreEqual(diamond.Score, 5);
     diamond = new Diamond(GameBonus.Great);
     Assert.AreEqual(diamond.Score, 10);
 }
Пример #2
0
        public void TestCanBePlaced_Player()
        {
            GameMap map = new GameMap(80, 20, 1, 1, new Point(40, 0), new Ball(40, 0));
            IGameObject diamond = new Diamond(GameBonus.Average ,1, 1);
            map.AddGameObject(diamond);

            Assert.IsTrue(map.CanBePlaced(diamond, 0, 0));
            Assert.IsTrue(map.CanBePlaced(diamond, 9, 4));
            Assert.IsTrue(map.CanBePlaced(diamond, 2, 1));

            Assert.IsFalse(map.CanBePlaced(diamond, -1, 0));
            Assert.IsFalse(map.CanBePlaced(diamond, 0, -1));
            Assert.IsFalse(map.CanBePlaced(diamond, 90, 0));
        }
Пример #3
0
        public void TestConstructors()
        {
            Diamond diamond = new Diamond(GameBonus.Common);

            Assert.AreEqual(diamond.DiamondType, GameBonus.Common);
            Assert.AreEqual(diamond.Score, 2);
            Assert.AreEqual(diamond.CPoint, new Point(0, 0));
            Assert.IsNull(diamond.Map);

            diamond = new Diamond(GameBonus.Great, 3, 4);
            Assert.AreEqual(diamond.DiamondType, GameBonus.Great);
            Assert.AreEqual(diamond.Score, 10);
            Assert.AreEqual(diamond.CPoint, new Point(3, 4));
            Assert.IsNull(diamond.Map);
        }
Пример #4
0
 public void TestCanBePlaced_Player_Does_Not_Belong_To()
 {
     GameMap map = new GameMap(80, 20, 1, 1, new Point(40, 0), new Ball(40, 0));
     IGameObject diamond = new Diamond(GameBonus.Average, 1, 1);
     Assert.IsFalse(map.CanBePlaced(diamond, 0, 5));
 }