| 6 | namespace ftg { |
| 7 | |
| 8 | TEST(TestArrayInfo, ToJsonP) { |
| 9 | std::string ExpectedJsonStr = R"( |
| 10 | { |
| 11 | "Incomplete" : false, |
| 12 | "LengthType" : 2, |
| 13 | "MaxLength" : 20 |
| 14 | })"; |
| 15 | Json::Value ExpectedJson = util::strToJson(ExpectedJsonStr); |
| 16 | |
| 17 | std::unique_ptr<ArrayInfo> ArrInfo = std::make_unique<ArrayInfo>(); |
| 18 | ArrInfo->setIncomplete(false); |
| 19 | ArrInfo->setLengthType(ArrayInfo::FIXED); |
| 20 | ArrInfo->setMaxLength(20); |
| 21 | |
| 22 | auto ArrInfoJson = ArrInfo->toJson(); |
| 23 | ASSERT_EQ(ArrInfoJson.toStyledString(), ExpectedJson.toStyledString()); |
| 24 | } |
| 25 | |
| 26 | TEST(TestArrayInfo, ToJsonWithUnsetN) { |
| 27 | std::string ExpectedJsonStr = R"( |
nothing calls this directly
no test coverage detected