MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

valdi/test/runtime/CppGeneratedClass_tests.cpp:292–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290};
291
292TEST(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
318TEST(CppGeneratedClass, canUnmarshallObjectFromMap) {
319 MyCard out;

Callers

nothing calls this directly

Calls 15

MyModelInterface · 0.85
extractErrorMethod · 0.80
getTypedObjectRefMethod · 0.80
descriptionMethod · 0.80
use_countMethod · 0.80
getObjectProxyForIdMethod · 0.80
setPropertyForNameMethod · 0.80
getSchemaForTypeKeyMethod · 0.80
setFutureMethod · 0.80

Tested by

no test coverage detected