| 290 | }; |
| 291 | |
| 292 | TEST(CppGeneratedClass, canMarshallObject) { |
| 293 | MyCard object; |
| 294 | |
| 295 | object.title = STRING_LITERAL("Hello World"); |
| 296 | object.width = 42; |
| 297 | object.height = 100; |
| 298 | object.selected = {true}; |
| 299 | |
| 300 | SimpleExceptionTracker exceptionTracker; |
| 301 | Value out; |
| 302 | MyCard::marshall(exceptionTracker, object, out); |
| 303 | ASSERT_TRUE(exceptionTracker) << exceptionTracker.extractError(); |
| 304 | |
| 305 | auto typedObject = out.getTypedObjectRef(); |
| 306 | ASSERT_TRUE(typedObject != nullptr); |
| 307 | |
| 308 | ASSERT_EQ(Value() |
| 309 | .setMapValue("title", Value(STRING_LITERAL("Hello World"))) |
| 310 | .setMapValue("subtitle", Value::undefined()) |
| 311 | .setMapValue("width", Value(42.0)) |
| 312 | .setMapValue("height", Value(100.0)) |
| 313 | .setMapValue("selected", Value(true)) |
| 314 | .setMapValue("onTap", Value::undefined()), |
| 315 | Value(typedObject->toValueMap())); |
| 316 | } |
| 317 | |
| 318 | TEST(CppGeneratedClass, canUnmarshallObjectFromMap) { |
| 319 | MyCard out; |
nothing calls this directly
no test coverage detected