Add unit test to verify non-accessory items cannot be disassembled.
This commit is contained in:
parent
830b893b1c
commit
9640014442
@ -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…
x
Reference in New Issue
Block a user