| 7 | using namespace Star; |
| 8 | |
| 9 | TEST(ItemTest, ItemDescriptorConstruction) { |
| 10 | ItemDescriptor testItemDescriptor; |
| 11 | |
| 12 | testItemDescriptor = ItemDescriptor(); |
| 13 | |
| 14 | testItemDescriptor = ItemDescriptor(Json()); |
| 15 | |
| 16 | String nameOnly = "perfectlygenericitem"; |
| 17 | testItemDescriptor = ItemDescriptor(nameOnly); |
| 18 | |
| 19 | List<JsonArray> arrayFormats = List<JsonArray>{ |
| 20 | JsonArray{"perfectlygenericitem"}, |
| 21 | JsonArray{"perfectlygenericitem", 1}, |
| 22 | JsonArray{"perfectlygenericitem", 1, JsonObject()}, |
| 23 | JsonArray{"perfectlygenericitem", 1, JsonObject{{"testParameter", "testValue"}}} |
| 24 | }; |
| 25 | |
| 26 | for (auto arrayFormat : arrayFormats) |
| 27 | testItemDescriptor = ItemDescriptor(arrayFormat); |
| 28 | |
| 29 | List<JsonObject> objectFormats = List<JsonObject>{ |
| 30 | JsonObject{{"name", "perfectlygenericitem"}}, |
| 31 | JsonObject{{"item", "perfectlygenericitem"}}, |
| 32 | JsonObject{{"name", "perfectlygenericitem"}, {"count", 1}}, |
| 33 | JsonObject{{"name", "perfectlygenericitem"}, {"count", 1}, {"parameters", JsonObject()}}, |
| 34 | JsonObject{{"name", "perfectlygenericitem"}, {"count", 1}, {"parameters", JsonObject{{"testParameter", "testValue"}}}} |
| 35 | }; |
| 36 | |
| 37 | for (auto objectFormat : objectFormats) |
| 38 | testItemDescriptor = ItemDescriptor(objectFormat); |
| 39 | |
| 40 | testItemDescriptor = ItemDescriptor("perfectlygenericitem", 1); |
| 41 | testItemDescriptor = ItemDescriptor("perfectlygenericitem", 1, JsonObject{{"testParameter", "testValue"}}); |
| 42 | } |
| 43 | |
| 44 | TEST(ItemTest, ItemComparison) { |
| 45 | auto itemDatabase = Root::singleton().itemDatabase(); |
nothing calls this directly
no test coverage detected