@@ -354,6 +354,66 @@ public void LastIndexOf_UCodepoint(string testString, UCodepoint codePoint,
354354 }
355355 #endregion
356356
357+ #region StartsWith_UCodepoint tests
358+ private static IEnumerable < object [ ] > UCodepointStartsWithTestData =>
359+ [
360+ [ "" , ( UCodepoint ) 'A' , true , false ] ,
361+ [ "" , ( UCodepoint ) 'A' , false , false ] ,
362+ [ "This test!" , ( UCodepoint ) 'h' , false , false ] ,
363+ [ "This test!" , ( UCodepoint ) 'T' , false , true ] ,
364+ [ "This test!" , ( UCodepoint ) 'T' , true , true ] ,
365+ [ "This test!" , ( UCodepoint ) 't' , false , false ] ,
366+ [ "This test!" , ( UCodepoint ) 't' , true , true ] ,
367+ [ "العربية" , ( UCodepoint ) 'ا' , false , true ] ,
368+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010570 " , 0 ) , false , true ] , // VITHKUQI letters
369+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010570 " , 0 ) , true , true ] , // VITHKUQI letters
370+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010597 " , 0 ) , false , false ] , // VITHKUQI letters
371+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010597 " , 0 ) , true , true ] , // VITHKUQI letters
372+ ] ;
373+
374+ [ TestMethod ]
375+ [ DynamicData ( nameof ( UCodepointStartsWithTestData ) ) ]
376+ public void StartsWith_UCodepoint ( string testString , UCodepoint codePoint , bool ignoreCase , bool expectedResult )
377+ {
378+ UString us = new ( testString ) ;
379+ Assert . AreEqual ( expectedResult , us . StartsWith ( codePoint , ignoreCase ) ) ;
380+
381+ // Test making sure that a substring results in the correct result
382+ us = CreateTestSubstring ( testString ) ;
383+ Assert . AreEqual ( expectedResult , us . StartsWith ( codePoint , ignoreCase ) ) ;
384+ }
385+ #endregion
386+
387+ #region EndsWith_UCodepoint tests
388+ private static IEnumerable < object [ ] > UCodepointEndsWithTestData =>
389+ [
390+ [ "" , ( UCodepoint ) 'A' , true , false ] ,
391+ [ "" , ( UCodepoint ) 'A' , false , false ] ,
392+ [ "This test" , ( UCodepoint ) 's' , false , false ] ,
393+ [ "This test" , ( UCodepoint ) 't' , false , true ] ,
394+ [ "This test" , ( UCodepoint ) 't' , true , true ] ,
395+ [ "This test" , ( UCodepoint ) 'T' , false , false ] ,
396+ [ "This test" , ( UCodepoint ) 'T' , true , true ] ,
397+ [ "العربية" , ( UCodepoint ) 'ة' , false , true ] ,
398+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010597 " , 0 ) , false , true ] , // VITHKUQI letters
399+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010597 " , 0 ) , true , true ] , // VITHKUQI letters
400+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010570 " , 0 ) , false , false ] , // VITHKUQI letters
401+ [ "\U00010570 \U00010597 " , UCodepoint . ReadFromStr ( "\U00010570 " , 0 ) , true , true ] , // VITHKUQI letters
402+ ] ;
403+
404+ [ TestMethod ]
405+ [ DynamicData ( nameof ( UCodepointEndsWithTestData ) ) ]
406+ public void EndsWith_UCodepoint ( string testString , UCodepoint codePoint , bool ignoreCase , bool expectedResult )
407+ {
408+ UString us = new ( testString ) ;
409+ Assert . AreEqual ( expectedResult , us . EndsWith ( codePoint , ignoreCase ) ) ;
410+
411+ // Test making sure that a substring results in the correct result
412+ us = CreateTestSubstring ( testString ) ;
413+ Assert . AreEqual ( expectedResult , us . EndsWith ( codePoint , ignoreCase ) ) ;
414+ }
415+ #endregion
416+
357417 #region IsNullOrEmpty tests
358418 private static IEnumerable < object ? [ ] > IsNullOrEmptyTestData =>
359419 [
0 commit comments