@@ -274,6 +274,86 @@ - (void)testHandleTokenFetchEMMError_errorIsNotEMM {
274274 [self waitForExpectations: @[ called ] timeout: 1 ];
275275}
276276
277+ # pragma mark - String Conversion Tests
278+
279+ - (void )testParametersWithParameters_withAnyNumber_isConvertedToString {
280+ NSDictionary *inputParameters = @{ @" number_key" : @12345 };
281+
282+ NSDictionary *stringifiedParameters = [GIDEMMSupport parametersWithParameters: inputParameters
283+ emmSupport: @" 1"
284+ isPasscodeInfoRequired: NO ];
285+
286+ XCTAssertEqualObjects (stringifiedParameters[@" number_key" ], @" 12345" ,
287+ @" The NSNumber should be converted to a string." );
288+ XCTAssertTrue ([stringifiedParameters[@" number_key" ] isKindOfClass: [NSString class ]],
289+ @" The final value should be of a NSString type." );
290+ }
291+
292+ - (void )testParametersWithParameters_withNumberOne_isConvertedToString {
293+ NSDictionary *inputParameters = @{ @" number_key" : @1 };
294+
295+ NSDictionary *stringifiedParameters = [GIDEMMSupport parametersWithParameters: inputParameters
296+ emmSupport: @" 1"
297+ isPasscodeInfoRequired: NO ];
298+
299+ XCTAssertEqualObjects (stringifiedParameters[@" number_key" ], @" 1" ,
300+ @" The NSNumber should be converted to a string." );
301+ XCTAssertTrue ([stringifiedParameters[@" number_key" ] isKindOfClass: [NSString class ]],
302+ @" The final value should be of a NSString type." );
303+ }
304+
305+ - (void )testParametersWithParameters_withNumberZero_isConvertedToString {
306+ NSDictionary *inputParameters = @{ @" number_key" : @0 };
307+
308+ NSDictionary *stringifiedParameters = [GIDEMMSupport parametersWithParameters: inputParameters
309+ emmSupport: @" 1"
310+ isPasscodeInfoRequired: NO ];
311+
312+ XCTAssertEqualObjects (stringifiedParameters[@" number_key" ], @" 0" ,
313+ @" The NSNumber should be converted to a string." );
314+ XCTAssertTrue ([stringifiedParameters[@" number_key" ] isKindOfClass: [NSString class ]],
315+ @" The final value should be of a NSString type." );
316+ }
317+
318+ - (void )testParametersWithParameters_withBooleanYes_isConvertedToTrueString {
319+ NSDictionary *inputParameters = @{ @" bool_key" : @YES };
320+
321+ NSDictionary *stringifiedParameters = [GIDEMMSupport parametersWithParameters: inputParameters
322+ emmSupport: @" 1"
323+ isPasscodeInfoRequired: NO ];
324+
325+ XCTAssertEqualObjects (stringifiedParameters[@" bool_key" ], @" true" ,
326+ @" The boolean YES should be converted to the string 'true'." );
327+ XCTAssertTrue ([stringifiedParameters[@" bool_key" ] isKindOfClass: [NSString class ]],
328+ @" The final value should be of a NSString type." );
329+ }
330+
331+ - (void )testParametersWithParameters_withBooleanNo_isConvertedToFalseString {
332+ NSDictionary *inputParameters = @{ @" bool_key" : @NO };
333+
334+ NSDictionary *stringifiedParameters = [GIDEMMSupport parametersWithParameters: inputParameters
335+ emmSupport: @" 1"
336+ isPasscodeInfoRequired: NO ];
337+
338+ XCTAssertEqualObjects (stringifiedParameters[@" bool_key" ], @" false" ,
339+ @" The boolean NO should be converted to the string 'false'." );
340+ XCTAssertTrue ([stringifiedParameters[@" bool_key" ] isKindOfClass: [NSString class ]],
341+ @" The final value should be of a NSString type." );
342+ }
343+
344+ - (void )testParametersWithParameters_withString_remainsUnchanged {
345+ NSDictionary *inputParameters = @{ @" string_key" : @" hello" };
346+
347+ NSDictionary *stringifiedParameters = [GIDEMMSupport parametersWithParameters: inputParameters
348+ emmSupport: @" 1"
349+ isPasscodeInfoRequired: NO ];
350+
351+ XCTAssertEqualObjects (stringifiedParameters[@" string_key" ], @" hello" ,
352+ @" The original string value should be preserved." );
353+ XCTAssertTrue ([stringifiedParameters[@" string_key" ] isKindOfClass: [NSString class ]],
354+ @" The final value should be of a NSString type." );
355+ }
356+
277357# pragma mark - Helpers
278358
279359- (NSString *)systemVersion {
0 commit comments