1111using System . Linq . Expressions ;
1212using System . Net ;
1313using System . Text ;
14+ using System . Threading ;
1415using System . Threading . Tasks ;
1516using System . Web ;
1617using System . Web . Caching ;
4142using NuGetGallery . Security ;
4243using NuGetGallery . Services ;
4344using NuGetGallery . Services . Helpers ;
45+ using NuGetGallery . TestUtils ;
4446using Xunit ;
47+ using Xunit . Sdk ;
4548
4649namespace NuGetGallery
4750{
@@ -216,7 +219,7 @@ private static PackagesController CreateController(
216219 featureFlagService = new Mock < IFeatureFlagService > ( ) ;
217220 featureFlagService . SetReturnsDefault < bool > ( true ) ;
218221 }
219-
222+
220223 renameService = renameService ?? new Mock < IPackageRenameService > ( ) ;
221224 if ( deprecationService == null )
222225 {
@@ -826,8 +829,8 @@ public async Task GivenAnAbsoluteLatestVersionItReturnsTheFirstLatestSemVer2()
826829 var deprecationService = new Mock < IPackageDeprecationService > ( ) ;
827830 var controller = CreateController (
828831 GetConfigurationService ( ) ,
829- packageService : packageService ,
830- indexingService : indexingService ,
832+ packageService : packageService ,
833+ indexingService : indexingService ,
831834 deprecationService : deprecationService ) ;
832835 controller . SetCurrentUser ( TestUtility . FakeUser ) ;
833836
@@ -905,8 +908,8 @@ public async Task GivenAnAbsoluteLatestVersionAndNoLatestSemVer2ItFiltersTheList
905908 var deprecationService = new Mock < IPackageDeprecationService > ( ) ;
906909 var controller = CreateController (
907910 GetConfigurationService ( ) ,
908- packageService : packageService ,
909- indexingService : indexingService ,
911+ packageService : packageService ,
912+ indexingService : indexingService ,
910913 deprecationService : deprecationService ) ;
911914 controller . SetCurrentUser ( TestUtility . FakeUser ) ;
912915
@@ -1066,8 +1069,8 @@ private async Task<ActionResult> GetResultWithReadMe(string readMeHtml, bool has
10661069 var fileService = new Mock < IPackageFileService > ( ) ;
10671070 var controller = CreateController (
10681071 GetConfigurationService ( ) ,
1069- packageService : packageService ,
1070- indexingService : indexingService ,
1072+ packageService : packageService ,
1073+ indexingService : indexingService ,
10711074 packageFileService : fileService ,
10721075 deprecationService : deprecationService ) ;
10731076 controller . SetCurrentUser ( TestUtility . FakeUser ) ;
@@ -1126,9 +1129,9 @@ public async Task GetsValidationIssues()
11261129
11271130 var controller = CreateController (
11281131 GetConfigurationService ( ) ,
1129- packageService : packageService ,
1130- indexingService : indexingService ,
1131- packageFileService : fileService ,
1132+ packageService : packageService ,
1133+ indexingService : indexingService ,
1134+ packageFileService : fileService ,
11321135 validationService : validationService ,
11331136 deprecationService : deprecationService ) ;
11341137 controller . SetCurrentUser ( TestUtility . FakeUser ) ;
@@ -1803,7 +1806,7 @@ public async Task WhenCacheIsOccupiedGetProperPackageDependent()
18031806
18041807 var result = await controller . DisplayPackage ( id , version : null ) ;
18051808 var model = ResultAssert . IsView < DisplayPackageViewModel > ( result ) ;
1806-
1809+
18071810 Assert . Same ( pd , model . PackageDependents ) ;
18081811 packageService
18091812 . Verify ( iup => iup . GetPackageDependents ( It . IsAny < string > ( ) ) , Times . Never ( ) ) ;
@@ -1933,7 +1936,7 @@ protected override void Dispose(bool disposing)
19331936
19341937 base . Dispose ( disposing ) ;
19351938 }
1936-
1939+
19371940 private class TestIssue : ValidationIssue
19381941 {
19391942 private readonly string _message ;
@@ -3809,7 +3812,7 @@ public void UsesProperIconUrl(User currentUser, User owner)
38093812 }
38103813
38113814
3812- private ActionResult GetDeleteSymbolsResult ( User currentUser , User owner , out PackagesController controller , Mock < IIconUrlProvider > iconUrlProvider = null )
3815+ private ActionResult GetDeleteSymbolsResult ( User currentUser , User owner , out PackagesController controller , Mock < IIconUrlProvider > iconUrlProvider = null )
38133816 {
38143817 _packageRegistration . Owners . Add ( owner ) ;
38153818
@@ -4327,7 +4330,7 @@ public async Task WhenPackageRegistrationIsLockedReturns403()
43274330 . Returns ( package ) ;
43284331
43294332 var controller = CreateController (
4330- GetConfigurationService ( ) ,
4333+ GetConfigurationService ( ) ,
43314334 packageService : packageService ,
43324335 packageUpdateService : packageUpdateService ) ;
43334336
@@ -6027,6 +6030,7 @@ public async Task WillShowViewWithErrorsIfEnsureValidThrowsExceptionMessage(Type
60276030 }
60286031
60296032 [ Fact ]
6033+ [ UseInvariantCultureAttribute ]
60306034 public async Task WillRejectBrokenZipFiles ( )
60316035 {
60326036 // Arrange
@@ -6041,7 +6045,7 @@ public async Task WillRejectBrokenZipFiles()
60416045 controller . SetCurrentUser ( TestUtility . FakeUser ) ;
60426046
60436047 var result = await controller . UploadPackage ( fakeUploadedFile . Object ) as JsonResult ;
6044-
6048+
60456049 Assert . NotNull ( result ) ;
60466050 Assert . Equal ( "Central Directory corrupt." , ( result . Data as JsonValidationMessage [ ] ) [ 0 ] . PlainTextMessage ) ;
60476051 }
@@ -6075,6 +6079,7 @@ public async Task WillShowViewWithErrorsIfPackageIdIsInvalid(string packageId)
60756079 [ Theory ]
60766080 [ InlineData ( "Contains#Invalid$Characters!@#$%^&*" ) ]
60776081 [ InlineData ( "Contains#Invalid$Characters!@#$%^&*EndsOnValidCharacter" ) ]
6082+ [ UseInvariantCultureAttribute ]
60786083 public async Task WillShowViewWithErrorsIfPackageIdIsBreaksParsing ( string packageId )
60796084 {
60806085 // Arrange
@@ -9000,7 +9005,7 @@ public async Task ReturnsProperResponseModelWhenSucceeds()
90009005
90019006 readmeService
90029007 . Setup ( rs => rs . GetReadMeHtmlAsync ( request , It . IsAny < Encoding > ( ) ) )
9003- . ReturnsAsync ( new RenderedReadMeResult { Content = html } ) ;
9008+ . ReturnsAsync ( new RenderedReadMeResult { Content = html } ) ;
90049009
90059010 var result = await controller . PreviewReadMe ( request ) ;
90069011
0 commit comments