@@ -8,6 +8,13 @@ namespace System.Globalization.Tests
88{
99 public class DateTimeFormatInfoShortDatePattern
1010 {
11+ public static IEnumerable < object [ ] > ShortDatePattern_Get_TestData ( )
12+ {
13+ yield return new object [ ] { DateTimeFormatInfo . InvariantInfo , "MM/dd/yyyy" , "invariant" } ;
14+ yield return new object [ ] { new CultureInfo ( "en-US" ) . DateTimeFormat , "M/d/yyyy" , "en-US" } ;
15+ yield return new object [ ] { new CultureInfo ( "fr-FR" ) . DateTimeFormat , "dd/MM/yyyy" , "fr-FR" } ;
16+ }
17+
1118 public static IEnumerable < object [ ] > ShortDatePattern_Get_TestData_HybridGlobalization ( )
1219 {
1320 // see the comments on the right to check the non-Hybrid result, if it differs
@@ -131,7 +138,6 @@ public static IEnumerable<object[]> ShortDatePattern_Get_TestData_HybridGlobaliz
131138 yield return new object [ ] { new CultureInfo ( "en-ZA" ) . DateTimeFormat , "yyyy/MM/dd" } ;
132139 yield return new object [ ] { new CultureInfo ( "en-ZM" ) . DateTimeFormat , "dd/MM/yyyy" } ;
133140 yield return new object [ ] { new CultureInfo ( "en-ZW" ) . DateTimeFormat , "d/M/yyyy" } ;
134- yield return new object [ ] { new CultureInfo ( "en-US" ) . DateTimeFormat , "M/d/yyyy" } ;
135141 yield return new object [ ] { new CultureInfo ( "es-419" ) . DateTimeFormat , "d/M/yyyy" } ;
136142 yield return new object [ ] { new CultureInfo ( "es-ES" ) . DateTimeFormat , "d/M/yyyy" } ;
137143 yield return new object [ ] { new CultureInfo ( "es-MX" ) . DateTimeFormat , "dd/MM/yyyy" } ;
@@ -200,6 +206,13 @@ public static IEnumerable<object[]> ShortDatePattern_Get_TestData_HybridGlobaliz
200206 yield return new object [ ] { new CultureInfo ( "zh-TW" ) . DateTimeFormat , "yyyy/M/d" } ;
201207 }
202208
209+ [ ConditionalTheory ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsHybridGlobalizationOnOSX ) ) ]
210+ [ MemberData ( nameof ( ShortDatePattern_Get_TestData ) ) ]
211+ public void ShortDatePattern_Get_ReturnsExpected ( DateTimeFormatInfo format , string expected , string cultureName )
212+ {
213+ Assert . True ( expected == format . ShortDatePattern , $ "Failed for culture: { cultureName } . Expected: { expected } , Actual: { format . ShortDatePattern } ") ;
214+ }
215+
203216 [ ConditionalTheory ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsHybridGlobalizationOnBrowser ) ) ]
204217 [ MemberData ( nameof ( ShortDatePattern_Get_TestData_HybridGlobalization ) ) ]
205218 public void ShortDatePattern_Get_ReturnsExpected_HybridGlobalization ( DateTimeFormatInfo format , string expected )
0 commit comments