Add unit test to verify non-accessory items cannot be disassembled.

This commit is contained in:
sigonasr2 2024-07-31 04:48:35 -05:00
parent 830b893b1c
commit 9640014442
2 changed files with 15 additions and 1 deletions

View File

@ -193,5 +193,19 @@ namespace ItemTests
Assert::IsTrue(disassembleRingTest.expired(),L"Original reference to disassembled ring should now be invalid."); Assert::IsTrue(disassembleRingTest.expired(),L"Original reference to disassembled ring should now be invalid.");
Assert::AreEqual(1U,Inventory::GetItemCount(ITEM_DATA["Ring of the Slime King"].FragmentName()),L"Disassembly has given us a Slime King Ring Fragment."); Assert::AreEqual(1U,Inventory::GetItemCount(ITEM_DATA["Ring of the Slime King"].FragmentName()),L"Disassembly has given us a Slime King Ring Fragment.");
} }
TEST_METHOD(DisassembleNonAccessoryTest){
try{
Inventory::Disassemble(Inventory::AddItem("Test Armor"s));
Assert::Fail(L"Disassembling Test Armor succeeded! This should NOT be allowed!");
}catch(std::runtime_error&e){}
try{
Inventory::Disassemble(Inventory::AddItem("Green Slime Remains"s));
Assert::Fail(L"Disassembling Green Slime Remains succeeded! This should NOT be allowed!");
}catch(std::runtime_error&e){}
try{
Inventory::Disassemble(Inventory::AddItem("Health Potion"s));
Assert::Fail(L"Disassembling a Health Potion succeeded! This should NOT be allowed!");
}catch(std::runtime_error&e){}
}
}; };
} }

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 3 #define VERSION_PATCH 3
#define VERSION_BUILD 10476 #define VERSION_BUILD 10477
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a