@@ -866,58 +866,6 @@ private static Uri GetLicenseExpressionDeprecationUrl(string licenseExpression)
866866 return new Uri ( string . Format ( "https://licenses.nuget.org/{0}" , licenseExpression ) ) ;
867867 }
868868
869- private static string [ ] LicenseNodeVariants => new string [ ]
870- {
871- "<license/>" ,
872- "<license></license>" ,
873- "<license> </license>" ,
874- "<license>ttt</license>" ,
875- "<license type='file'>fff</license>" ,
876- "<license type='expression'>ee</license>" ,
877- "<license type='foobar'>ttt</license>" ,
878- "<license type='file'><someChildNode /></license>" ,
879- "<license type='file' version='1.0.0'>fff</license>" ,
880- "<license type='expression' version='1.0.0'>ee</license>" ,
881- "<license type='foobar' version='1.0.0'>ttt</license>" ,
882- "<license type='file' version='1.0.0'><someChildNode /></license>" ,
883- "<license type='file' version='2.0.0'>fff</license>" ,
884- "<license type='expression' version='2.0.0'>ee</license>" ,
885- "<license type='foobar' version='2.0.0'>ttt</license>" ,
886- "<license type='file' version='2.0.0'><someChildNode /></license>" ,
887- } ;
888-
889- public static IEnumerable < object [ ] > RejectsLicensedPackagesWhenConfigured_Input =>
890- from licenseNode in LicenseNodeVariants
891- select new object [ ] { licenseNode , true , false } ;
892-
893- [ Theory ]
894- [ MemberData ( nameof ( RejectsLicensedPackagesWhenConfigured_Input ) ) ]
895- public async Task RejectsLicensedPackagesWhenConfigured ( string licenseNode , bool rejectPackagesWithLicense , bool expectedSuccess )
896- {
897- _config
898- . SetupGet ( x => x . RejectPackagesWithLicense )
899- . Returns ( rejectPackagesWithLicense ) ;
900- _nuGetPackage = GeneratePackageWithUserContent ( getCustomNuspecNodes : ( ) => licenseNode ) ;
901-
902- var result = await _target . ValidateBeforeGeneratePackageAsync (
903- _nuGetPackage . Object ,
904- GetPackageMetadata ( _nuGetPackage ) ,
905- _currentUser ) ;
906-
907- if ( expectedSuccess )
908- {
909- Assert . Equal ( PackageValidationResultType . Accepted , result . Type ) ;
910- Assert . Null ( result . Message ) ;
911- Assert . Empty ( result . Warnings ) ;
912- }
913- else
914- {
915- Assert . Equal ( PackageValidationResultType . Invalid , result . Type ) ;
916- Assert . Contains ( "license" , result . Message . PlainTextMessage ) ;
917- Assert . Empty ( result . Warnings ) ;
918- }
919- }
920-
921869 [ Fact ]
922870 public async Task RejectsLongLicenses ( )
923871 {
0 commit comments