Assert::AreEqual(74,player->GetHealth());//Even though we are supposed to take 30 damage, damage reduction reduces it to 26 instead. (Random variance is controlled during testing. If this number changes at some point, either the damage formula or the item's stats have changed!)
//This gear is supposed to be provide an additional 100% defense, 100% Attack, 100% Move Spd, 100% CDR, 100% Crit Rate, 100% Crit Dmg, 100% Health %, 100% HP/6 Recovery
Assert::AreEqual(100.f+player->GetBaseStat("Defense %"),player->GetStat("Defense %"),L"Defense % stat was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("Attack %"),player->GetStat("Attack %"),L"Attack % stat was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("Move Spd %"),player->GetStat("Move Spd %"),L"Move Spd % stat was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("CDR"),player->GetStat("CDR"),L"CDR stat was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("Crit Rate"),player->GetStat("Crit Rate"),L"Crit Rate % stat was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("Crit Dmg"),player->GetStat("Crit Dmg"),L"Critical Damage stat was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("Health %"),player->GetStat("Health %"),L"Health Points was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("HP6 Recovery %"),player->GetStat("HP6 Recovery %"),L"HP/6s Recovery stat was not increased by 100%.");
//This gear is supposed to be provide an additional 100% HP/4 Recovery, 100% Damage Reduction
Assert::AreEqual(100.f+player->GetBaseStat("HP4 Recovery %"),player->GetStat("HP4 Recovery %"),L"HP/4s Recovery stat was not increased by 100%.");
Assert::AreEqual(100.f+player->GetBaseStat("Damage Reduction"),player->GetStat("Damage Reduction"),L"Damage Reduction stat was not increased by 100%.");
Assert::AreEqual(3.f,testRing.lock()->RandomStats().A_Read("Move Spd %"),L"Generated Ring 1 Move Spd % is incorrect.");
Assert::AreEqual(2.f,testRing.lock()->RandomStats().A_Read("Crit Rate"),L"Generated Ring 1 Crit Rate is incorrect.");
Assert::AreEqual(5.f,testRing.lock()->RandomStats().A_Read("Mana"),L"Generated Ring 1 Mana is incorrect.");
Assert::AreEqual(2.f,testRing2.lock()->RandomStats().A_Read("Move Spd %"),L"Generated Ring 2 Move Spd % is incorrect.");
Assert::AreEqual(2.f,testRing2.lock()->RandomStats().A_Read("Crit Rate"),L"Generated Ring 2 Crit Rate is incorrect.");
Assert::AreEqual(2.f,testRing2.lock()->RandomStats().A_Read("Mana"),L"Generated Ring 2 Mana is incorrect.");
Assert::IsTrue(testRing.lock()->RandomStats().A_Read("Move Spd %")>=ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Move Spd %")&&
testRing.lock()->RandomStats().A_Read("Move Spd %")<=ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Move Spd %"),std::format(L"Generated Move Spd % {} is out of bounds: Min:{} Max:{}",testRing.lock()->RandomStats().A_Read("Move Spd %"),ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Move Spd %"),ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Move Spd %")).c_str());
testRing.lock()->RandomStats().A_Read("Crit Rate")<=ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Crit Rate"),std::format(L"Generated Crit Rate {} is out of bounds: Min:{} Max:{}",testRing.lock()->RandomStats().A_Read("Crit Rate"),ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Move Spd %"),ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Crit Rate")).c_str());
testRing.lock()->RandomStats().A_Read("Mana")<=ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Mana"),std::format(L"Generated Mana {} is out of bounds: Min:{} Max:{}",testRing.lock()->RandomStats().A_Read("Mana"),ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Mana"),ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Mana")).c_str());
Assert::IsTrue(testRing2.lock()->RandomStats().A_Read("Move Spd %")>=ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Move Spd %")&&
testRing2.lock()->RandomStats().A_Read("Move Spd %")<=ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Move Spd %"),std::format(L"Generated Move Spd % {} is out of bounds: Min:{} Max:{}",testRing2.lock()->RandomStats().A_Read("Move Spd %"),ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Move Spd %"),ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Move Spd %")).c_str());
testRing2.lock()->RandomStats().A_Read("Crit Rate")<=ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Crit Rate"),std::format(L"Generated Crit Rate {} is out of bounds: Min:{} Max:{}",testRing2.lock()->RandomStats().A_Read("Crit Rate"),ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Move Spd %"),ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Crit Rate")).c_str());
testRing2.lock()->RandomStats().A_Read("Mana")<=ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Mana"),std::format(L"Generated Mana {} is out of bounds: Min:{} Max:{}",testRing2.lock()->RandomStats().A_Read("Mana"),ITEM_DATA.at("Bird's Treasure"s).GetMinStats().A_Read("Mana"),ITEM_DATA.at("Bird's Treasure"s).GetMaxStats().A_Read("Mana")).c_str());
//Ensure stats are default.
Assert::AreEqual(player->GetBaseStat("Move Spd %"),player->GetStat("Move Spd %"),L"Base Move Spd %does not match initial Move Spd %");
Assert::AreEqual(player->GetBaseStat("Crit Rate"),player->GetStat("Crit Rate"),L"Base Crit Rate does not match initial Crit Rate");
Assert::AreEqual(player->GetBaseStat("Mana"),player->GetStat("Mana"),L"Base Mana does not match initial Mana");
Inventory::EquipItem(testRing,EquipSlot::RING1);
Assert::AreEqual(3+player->GetBaseStat("Move Spd %"),player->GetStat("Move Spd %"),L"Move Spd % increased incorrectly when ring 1 equipped!");
Assert::AreEqual(2+player->GetBaseStat("Crit Rate"),player->GetStat("Crit Rate"),L"Crit Rate increased incorrectly when ring 1 equipped!");
Assert::AreEqual(5+player->GetBaseStat("Mana"),player->GetStat("Mana"),L"Mana increased incorrectly when ring 1 equipped!");
//Equipping to same slot should undo the previous stats and apply the new ring's stats.
Inventory::EquipItem(testRing2,EquipSlot::RING1);
Assert::AreEqual(2+player->GetBaseStat("Move Spd %"),player->GetStat("Move Spd %"),L"Move Spd % increased incorrectly when ring 1 equipped!");
Assert::AreEqual(2+player->GetBaseStat("Crit Rate"),player->GetStat("Crit Rate"),L"Crit Rate increased incorrectly when ring 1 equipped!");
Assert::AreEqual(2+player->GetBaseStat("Mana"),player->GetStat("Mana"),L"Mana increased incorrectly when ring 1 equipped!");
Inventory::UnequipItem(EquipSlot::RING1);
//Ensure stats are default again.
Assert::AreEqual(player->GetBaseStat("Move Spd %"),player->GetStat("Move Spd %"),L"Base Move Spd %does not match initial Move Spd % after unequipping the ring.");
Assert::AreEqual(player->GetBaseStat("Crit Rate"),player->GetStat("Crit Rate"),L"Base Crit Rate does not match initial Crit Rate after unequipping the ring.");
Assert::AreEqual(player->GetBaseStat("Mana"),player->GetStat("Mana"),L"Base Mana does not match initial Mana after unequipping the ring.");
Inventory::EquipItem(testRing,EquipSlot::RING1);
Inventory::EquipItem(testRing2,EquipSlot::RING2);
Assert::AreEqual(5+player->GetBaseStat("Move Spd %"),player->GetStat("Move Spd %"),L"Move Spd % increased incorrectly when both rings equipped!");
Assert::AreEqual(4+player->GetBaseStat("Crit Rate"),player->GetStat("Crit Rate"),L"Crit Rate increased incorrectly when both rings equipped!");
Assert::AreEqual(7+player->GetBaseStat("Mana"),player->GetStat("Mana"),L"Mana increased incorrectly when both rings equipped!");