Skip to content

Commit

Permalink
EES-5656 Correct mistake in UpdateReleaseSeries_UpdatesLatestPublishe…
Browse files Browse the repository at this point in the history
…dReleaseVersion
  • Loading branch information
benoutram committed Dec 20, 2024
1 parent a12a200 commit a15bf4f
Showing 1 changed file with 11 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2990,18 +2990,9 @@ public async Task UpdateReleaseSeries()
LegacyLinkDescription = "Legacy link new",
LegacyLinkUrl = "https://test.com/new"
},
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release2022.Id
},
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release2020.Id
},
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release2021.Id
}
new ReleaseSeriesItemUpdateRequest { ReleaseId = release2022.Id },
new ReleaseSeriesItemUpdateRequest { ReleaseId = release2020.Id },
new ReleaseSeriesItemUpdateRequest { ReleaseId = release2021.Id }
]);

VerifyAllMocks(publicationCacheService);
Expand Down Expand Up @@ -3059,7 +3050,7 @@ public async Task UpdateReleaseSeries()

// The publication's latest published release version should be unchanged as 2022 was positioned
// as the first release after the legacy link
Assert.Equal(release2022.Versions[1].Id, publication.LatestPublishedReleaseVersionId);
Assert.Equal(release2022.Versions[1].Id, actualPublication.LatestPublishedReleaseVersionId);
}
}

Expand Down Expand Up @@ -3123,18 +3114,9 @@ public async Task UpdateReleaseSeries_UpdatesLatestPublishedReleaseVersion()
publication.Id,
updatedReleaseSeriesItems:
[
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release2021.Id
},
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release2020.Id
},
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release2022.Id
}
new ReleaseSeriesItemUpdateRequest { ReleaseId = release2021.Id },
new ReleaseSeriesItemUpdateRequest { ReleaseId = release2020.Id },
new ReleaseSeriesItemUpdateRequest { ReleaseId = release2022.Id }
]);

VerifyAllMocks(publicationCacheService, releaseCacheService);
Expand Down Expand Up @@ -3181,7 +3163,8 @@ public async Task UpdateReleaseSeries_UpdatesLatestPublishedReleaseVersion()

// The latest published version of 2021 should now be the publication's latest published release
// version since it was positioned as the first release
Assert.Equal(release2022.Versions[1].Id, publication.LatestPublishedReleaseVersionId);
Assert.Equal(expectedLatestPublishedReleaseVersionId,
actualPublication.LatestPublishedReleaseVersionId);
}
}

Expand Down Expand Up @@ -3288,14 +3271,8 @@ public async Task UpdateReleaseSeries_SetDuplicateRelease()
publication.Id,
updatedReleaseSeriesItems:
[
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release.Id
},
new ReleaseSeriesItemUpdateRequest
{
ReleaseId = release.Id
}
new ReleaseSeriesItemUpdateRequest { ReleaseId = release.Id },
new ReleaseSeriesItemUpdateRequest { ReleaseId = release.Id }
]));

Assert.Equal($"Missing or duplicate release in new release series. Expected ReleaseIds: {release.Id}",
Expand Down

0 comments on commit a15bf4f

Please sign in to comment.