public void WeaponCollection_GetAllWeaponsOfType_ListOfWeapons(WeaponType type, int expectedValue) { // TODO: call WeaponCollection.GetAllWeaponsOfType(type) and confirm that the weapons list returns Count matches the expected value using asserts. int count = weaponCollection.GetAllWeaponsOfType(type).Count(); Assert.AreEqual(count, expectedValue); }
public void WeaponCollection_GetAllWeaponsOfType_ListOfWeapons(weapontype type, int expectedValue) { // TODO: call WeaponCollection.GetAllWeaponsOfType(type) and confirm that the weapons list returns Count matches the expected value using asserts. List <Weapon> weapon = weaponcollection.GetAllWeaponsOfType(type); //int count = 0; foreach (var line in weapon) { Assert.AreEqual(line.Type, type); //if (line.Type == type) //{ // count++; //} } Assert.AreEqual(weapon.Count, expectedValue); }