private Stone StoneGenerator() { Stone stone; if (rand.Next(3) > 0) { stone = new OrdinaryStone(); } else { stone = new ValuableStone(Convert.ToDouble(rand.Next(1, 100)) / 10); if (rand.Next(5) == 0) { stone = new DecryptionStone(stone); } if (rand.Next(6) == 0) { stone = new CollapseStone(rand.Next(1, 15), stone); } if (rand.Next(8) == 0) { stone = new PoisonedStone(rand.Next(1, 10), stone); } } return(stone); }
public void OrdinaryStoneTest() { var stone = new OrdinaryStone(); Assert.AreEqual(stone.GetInfo(), "Description: Ordinary stone, nothing cost"); Assert.AreEqual(stone.Weight, 0); Assert.AreEqual(stone.StoneHealth, 0); Assert.AreEqual(stone.Collapses, false); Assert.AreEqual(stone.Decryption, false); Assert.AreEqual(stone.GetCost(), 0); Assert.AreEqual(stone.Damage, 0); Assert.AreEqual(stone.Description, "Ordinary stone, nothing cost"); }