public void TestGenerateDelLily() { Enemy delLily = new Enemy(); delLily.setDropAnythingRate(0.35); delLily.setRareRate(0.015625); delLily.setEquipmentDropType(ItemDropType.WEAPON); ItemDropGenerator itemDropGenerator = new ItemDropGenerator(new RandomGenerator()); for(int i = 0; i < 10; i++) { ItemDropType result = itemDropGenerator.generateDrop(delLily); System.Console.WriteLine("Generated [" + result + "]"); } }
public void TestGenerateMeseta() { Enemy enemy = new Enemy(); enemy.setDropAnythingRate(50.0); enemy.setRareRate(50.0); enemy.setEquipmentDropType(ItemDropType.WEAPON); // Rig the random to return true for the DAR check MockRandomGenerator mockRandomGenerator = new MockRandomGenerator(); mockRandomGenerator.rigDropAnythingRate(true); mockRandomGenerator.rigRareRate(false); mockRandomGenerator.rigMesetaRate(true); ItemDropGenerator itemDropGenerator = new ItemDropGenerator(mockRandomGenerator); ItemDropType result = itemDropGenerator.generateDrop(enemy); Assert.AreEqual(ItemDropType.MESETA, result); }