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); }
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); }
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); }
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); }
public void CreateMineWithInvaludPowerShouldThrowExeption() { IMineFactory mineCreator = new MineCreator(); IExplodable lumpetByCreator = mineCreator.CreateMine(new MinePower()); // Hack the mine system }