private void ExpectFailure( CultureAttribute attr, string msg ) { if ( detector.IsCultureSupported( attr ) ) Assert.Fail( string.Format( "Should not match attribute with Include=\"{0}\",Exclude=\"{1}\"", attr.Include, attr.Exclude ) ); Assert.AreEqual( msg, detector.Reason ); }
public void CanMatchAttributeWithIncludeAndExclude() { CultureAttribute attr = new CultureAttribute( "en,fr,de,it" ); attr.Exclude="fr-CA,fr-BE"; ExpectMatch( attr ); attr.Exclude = "fr-FR"; ExpectFailure( attr, "Not supported under culture fr-FR" ); }
public void CanMatchAttributeWithExclude() { CultureAttribute attr = new CultureAttribute(); attr.Exclude = "en"; ExpectMatch( attr ); attr.Exclude = "en,de,it"; ExpectMatch( attr ); attr.Exclude = "fr"; ExpectFailure( attr, "Not supported under culture fr"); attr.Exclude = "fr-FR,fr-BE,fr-CA"; ExpectFailure( attr, "Not supported under culture fr-FR,fr-BE,fr-CA" ); }
private void ExpectMatch( CultureAttribute attr ) { if ( !detector.IsCultureSupported( attr ) ) Assert.Fail( string.Format( "Failed to match attribute with Include=\"{0}\",Exclude=\"{1}\"", attr.Include, attr.Exclude ) ); }