public void Test_Constructor_GoodParameters() { GameItem pointyStick = ItemFactory.CreateGameItem(1001); AttackWithWeapon attackWithWeapon = new AttackWithWeapon(pointyStick, 1, 5); Assert.IsNotNull(attackWithWeapon); }
public void Test_Constructor_GoodParametrs() { Item pen = ItemFactory.CreateItem(1); AttackWithWeapon attackWithWeapon = new AttackWithWeapon(pen, 1, 5); Assert.IsNotNull(attackWithWeapon); }
public void Test_Constructor_DamageDiceStringEmpty() { GameItem pointyStick = ItemFactory.CreateGameItem(1001); // This damage dice string must exist. // So, the constructor should throw an exception. AttackWithWeapon attackWithWeapon = new AttackWithWeapon(pointyStick, string.Empty); }
public void Test_Constructor_ItemIsNotAWeapon() { GameItem granolaBar = ItemFactory.CreateGameItem(2001); // A granola bar is not a weapon. // So, the constructor should throw an exception. AttackWithWeapon attackWithWeapon = new AttackWithWeapon(granolaBar, "1d5"); }
public void Test_Constructor_MaximumDamageLessThanMinimumDamage() { GameItem pointyStick = ItemFactory.CreateGameItem(1001); // This maximum damage is less than the minimum damage. // So, the constructor should throw an exception. AttackWithWeapon attackWithWeapon = new AttackWithWeapon(pointyStick, 2, 1); }
public void Test_Constructor_MinimumDamageLessThanZero() { var pointyStick = ItemFactory.CreateGameItem(1001); // This minimum damage value is less than 0. // So, the constructor should throw an exception. var attackWithWeapon = new AttackWithWeapon(pointyStick, -1, 5); }
public void Test_Constructor_MaximumDamageLessThanMinimum() { GameItem pointyStick = ItemFactory.CreateGameItem(1001); //constructor should throw an exception as maximum damage cannot be less than minimum AttackWithWeapon attackWithWeapon = new AttackWithWeapon(pointyStick, 2, 1); }
public GameItem(ItemCategory category, int itemTypeID, string name, int price, bool isUnique = false, AttackWithWeapon action = null) { Category = category; ItemTypeID = itemTypeID; Name = name; Price = price; IsUnique = isUnique; Action = action; }
public void Test_Constructor_ItemIsNotWeapon() { GameItem granolaBar = ItemFactory.CreateGameItem(2001); //granola bar is not a weapon //constructor should throw an exception AttackWithWeapon attackWithWeapon = new AttackWithWeapon(granolaBar, 1, 5); }
public void Test_Constructor_MaximumDamageLessThanMinimumDamage() { var pointyStick = ItemFactory.CreateGameItem(1001); var attackWithWeapon = new AttackWithWeapon(pointyStick, 6, 5); }
public void Test_Constructor_ItemIsNotAWeapon() { var granolaBar = ItemFactory.CreateGameItem(2001); var attackWithWeapon = new AttackWithWeapon(granolaBar, 1, 5); }
public void Test_Constructor_MaxDMGLessThanMinDMG() { GameItem pointyStick = ItemFactory.CreateGameItem(1001); AttackWithWeapon attackWithWeapon = new AttackWithWeapon(pointyStick, 2, 1); }
public void Test_Constructor_MinimumDamageLessThanZero() { GameItem pointyStick = ItemFactory.CreateGameItem(1001); AttackWithWeapon attackWithWeapon = new AttackWithWeapon(pointyStick, -1, 5); }
public void Test_Constructor_MaxDamageLessThanMin() { Item pen = ItemFactory.CreateItem(1); _ = new AttackWithWeapon(pen, 2, 1); }
public void Test_Constructor_MinDamageIsLessThanZero() { Item pen = ItemFactory.CreateItem(1); _ = new AttackWithWeapon(pen, -1, 5); }
public void Test_Constructor_ItemIsNotAWeapon() { Item pen = ItemFactory.CreateItem(6); _ = new AttackWithWeapon(pen, 1, 5); }