@@ -271,6 +271,27 @@ TEST_F(FirebaseAnalyticsTest, TestLogEventWithMultipleParameters) {
271
271
sizeof (kLevelUpParameters ) / sizeof (kLevelUpParameters [0 ]));
272
272
}
273
273
274
+ TEST_F (FirebaseAnalyticsTest, TestLogEventWithComplexParameters) {
275
+ // Define the items that will go into the kParameterItems list.
276
+ firebase::Variant first_item = firebase::Variant::EmptyMap ();
277
+ first_item.map ()[firebase::analytics::kParameterItemID ] = " SKU_12345" ;
278
+ first_item.map ()[firebase::analytics::kParameterItemName ] = " Horse Armor DLC" ;
279
+ firebase::Variant second_item = firebase::Variant::EmptyMap ();
280
+ second_item.map ()[firebase::analytics::kParameterItemID ] = " SKU_67890" ;
281
+ second_item.map ()[firebase::analytics::kParameterItemName ] = " Gold Horse Armor DLC" ;
282
+
283
+ // Define the parameters that are sent with the ViewCart event.
284
+ const firebase::analytics::Parameter kViewCartParameters [] = {
285
+ firebase::analytics::Parameter (firebase::analytics::kParameterCurrency , " USD" ),
286
+ firebase::analytics::Parameter (firebase::analytics::kParameterValue , 30.03 ),
287
+ firebase::analytics::Parameter (firebase::analytics::kParameterItems , std::vector<firebase::Variant>{ first_item, second_item }),
288
+ };
289
+
290
+ firebase::analytics::LogEvent (
291
+ firebase::analytics::kEventViewCart , kViewCartParameters ,
292
+ sizeof (kViewCartParameters ) / sizeof (kViewCartParameters [0 ]));
293
+ }
294
+
274
295
TEST_F (FirebaseAnalyticsTest, TestSetConsent) {
275
296
// On Android, this test must be performed at the end, after all the tests for
276
297
// session ID and instance ID. This is because once you call SetConsent to
0 commit comments