Skip to content

Commit

Permalink
Fix tests falling
Browse files Browse the repository at this point in the history
  • Loading branch information
Neakita committed Aug 24, 2024
1 parent a651720 commit f5e86f8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public ScreenshotsLibrary(DataSet dataSet)
public override Screenshot<TAsset> CreateScreenshot(DateTime creationDate, out ImmutableArray<Screenshot> removedScreenshots)
{
Screenshot<TAsset> screenshot = new(this, creationDate);
Guard.IsGreaterThan(creationDate, _screenshots[^1].CreationDate);
if (_screenshots.Count != 0)
Guard.IsGreaterThan(creationDate, _screenshots[^1].CreationDate);
_screenshots.Add(screenshot);
removedScreenshots = ClearExceed();
return screenshot;
Expand Down Expand Up @@ -70,7 +71,7 @@ private ImmutableArray<Screenshot> ClearExceed()
.OrderByDescending(tuple => tuple.start);
foreach (var (tuples, start, end) in screenshotsToDelete)
{
_screenshots.RemoveRange(start, end);
_screenshots.RemoveRange(start, end - start + 1);
builder.Capacity += tuples.Length;
foreach (var (screenshot, _) in tuples)
builder.Add(screenshot);
Expand Down

0 comments on commit f5e86f8

Please sign in to comment.