Exemplo n.º 1
0
        public void TestIsNavelMine()
        {
            IMineFactory mineCreator = new MineCreator();
            IExplodable  navelMine   = mineCreator.CreateMine(MinePower.Three); // Should return 'Navel Mine'
            bool         isNavelMine = navelMine is NavelMine;

            Assert.IsTrue(isNavelMine);
        }
Exemplo n.º 2
0
        public void TestIsFatherBomb()
        {
            IMineFactory mineCreator  = new MineCreator();
            IExplodable  fatherBomb   = mineCreator.CreateMine(MinePower.Five); // Should return 'Father Bomb'
            bool         isFatherBomb = fatherBomb is FatherBomb;

            Assert.IsTrue(isFatherBomb);
        }
Exemplo n.º 3
0
        public void TestIsLandMine()
        {
            IMineFactory mineCreator = new MineCreator();
            IExplodable  landMine    = mineCreator.CreateMine(MinePower.Two); // Should return 'Land Mine'
            bool         isLandMine  = landMine is LandMine;

            Assert.IsTrue(isLandMine);
        }
Exemplo n.º 4
0
        public void CreateMineShouldReturnProperMines()
        {
            IMineFactory mineCreator      = new MineCreator();
            IExplodable  lumpetByCreator  = mineCreator.CreateMine(MinePower.One);  // Should return 'Lumpet Mine'
            IExplodable  nuclearByCreator = mineCreator.CreateMine(MinePower.Four); // Should return 'Nuclear Mine';
            bool         isLumpet         = lumpetByCreator is LimpetMine;
            bool         isNuclear        = nuclearByCreator is NuclearMine;

            Assert.IsTrue(isLumpet && isNuclear);
        }
Exemplo n.º 5
0
 public void CreateMineWithInvaludPowerShouldThrowExeption()
 {
     IMineFactory mineCreator     = new MineCreator();
     IExplodable  lumpetByCreator = mineCreator.CreateMine(new MinePower());   // Hack the mine system
 }