Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
drewgillies committed Jan 7, 2021
1 parent be32264 commit 83bb005
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Package FilterLatestPackage(
Package FilterLatestPackageBySuffix(IReadOnlyCollection<Package> packages,
string version, bool prerelease);

IEnumerable<Package> FindPackagesByOwner(User user, bool includeUnlisted, bool includeVersions = false);
IEnumerable<Package> FindPackagesByOwner(User user, bool includeUnlisted, bool includeVersions = false, bool includeVulnerabilities = false);

IEnumerable<Package> FindPackagesByAnyMatchingOwner(User user, bool includeUnlisted, bool includeVersions = false, bool includeVulnerabilities = false);

Expand Down
5 changes: 3 additions & 2 deletions src/NuGetGallery.Services/PackageManagement/PackageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,10 @@ private static Package FilterLatestPackageHelper(

public IEnumerable<Package> FindPackagesByOwner(User user,
bool includeUnlisted,
bool includeVersions = false)
bool includeVersions = false,
bool includeVulnerabilities = false)
{
return GetPackagesForOwners(new[] { user.Key }, includeUnlisted, includeVersions, includeVulnerabilities: false);
return GetPackagesForOwners(new[] { user.Key }, includeUnlisted, includeVersions, includeVulnerabilities);
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions tests/AccountDeleter.Facts/EvaluatorFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public EvaluatorFacts(ITestOutputHelper output)
public void NuGetDeleteevaluatorReturnsCorrectValueForUnconfirmed()
{
// Setup
_packageService.Setup(ps => ps.FindPackagesByOwner(It.IsAny<User>(), It.IsAny<bool>(), It.IsAny<bool>()))
_packageService.Setup(ps => ps.FindPackagesByOwner(It.IsAny<User>(), It.IsAny<bool>(), It.IsAny<bool>(), It.IsAny<bool>()))
.Returns(() =>
{
return new List<Package>();
Expand All @@ -58,7 +58,7 @@ public void NuGetDeleteevaluatorReturnsCorrectValueForUnconfirmed()
public void NuGetDeleteevaluatorReturnsCorrectValueForPackages(bool userHasPackages, bool expectedResult)
{
// Setup
_packageService.Setup(ps => ps.FindPackagesByOwner(It.IsAny<User>(), It.IsAny<bool>(), It.IsAny<bool>()))
_packageService.Setup(ps => ps.FindPackagesByOwner(It.IsAny<User>(), It.IsAny<bool>(), It.IsAny<bool>(), It.IsAny<bool>()))
.Returns(() =>
{
if (userHasPackages)
Expand Down Expand Up @@ -94,7 +94,7 @@ public void NuGetDeleteevaluatorReturnsCorrectValueForPackages(bool userHasPacka
public void NuGetDeleteevaluatorReturnsCorrectValueForOrganizations(bool userHasOrgs, bool userIsAdmin, bool expectedResult)
{
// Setup
_packageService.Setup(ps => ps.FindPackagesByOwner(It.IsAny<User>(), It.IsAny<bool>(), It.IsAny<bool>()))
_packageService.Setup(ps => ps.FindPackagesByOwner(It.IsAny<User>(), It.IsAny<bool>(), It.IsAny<bool>(), It.IsAny<bool>()))
.Returns(() =>
{
return new List<Package>();
Expand Down
6 changes: 3 additions & 3 deletions tests/NuGetGallery.Facts/Controllers/UsersControllerFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ public void ReturnsSinglePackageAsExpected(User currentUser, User owner)
.Returns(owner);

GetMock<IPackageService>()
.Setup(x => x.FindPackagesByOwner(owner, false, false))
.Setup(x => x.FindPackagesByOwner(owner, false, false, false))
.Returns(new[] { package, invalidatedPackage, validatingPackage, deletedPackage });

var controller = GetController<UsersController>();
Expand Down Expand Up @@ -1153,7 +1153,7 @@ public void SortsPackagesByDownloadCount(User currentUser, User owner)
.Returns(owner);

GetMock<IPackageService>()
.Setup(x => x.FindPackagesByOwner(owner, false, false))
.Setup(x => x.FindPackagesByOwner(owner, false, false, false))
.Returns(new[] { package1, package2 });

var controller = GetController<UsersController>();
Expand Down Expand Up @@ -1195,7 +1195,7 @@ public void UsesProperIconUrl(User currentUser, User owner)
.Setup(x => x.FindByUsername(username, false))
.Returns(owner);
GetMock<IPackageService>()
.Setup(x => x.FindPackagesByOwner(owner, false, false))
.Setup(x => x.FindPackagesByOwner(owner, false, false, false))
.Returns(new[] { userPackage });

var controller = GetController<UsersController>();
Expand Down

0 comments on commit 83bb005

Please sign in to comment.