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

mac-build
sigonasr2 4 months ago
parent 97040ef051
commit 30b8760fd6
  1. 14
      Adventures in Lestoria Tests/ItemTests.cpp
  2. 2
      Adventures in Lestoria/Version.h

@ -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){}
}
}; };
} }

@ -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

Loading…
Cancel
Save