Skip to content

Commit

Permalink
Make ClearExceed private and remove abstract version from base class,…
Browse files Browse the repository at this point in the history
… rename AddScreenshot back to CreateScreenshot
  • Loading branch information
Neakita committed Aug 24, 2024
1 parent d580552 commit 7bae77d
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions SightKeeper.Application/ScreenshotsDataAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class ScreenshotsDataAccess

public Screenshot CreateScreenshot(ScreenshotsLibrary library, byte[] data, DateTime creationDate)
{
var screenshot = library.AddScreenshot(creationDate, out var removedScreenshots);
var screenshot = library.CreateScreenshot(creationDate, out var removedScreenshots);
foreach (var removedScreenshot in removedScreenshots)
DeleteScreenshotData(removedScreenshot);
SaveScreenshotData(screenshot, data);
Expand All @@ -29,7 +29,7 @@ public Screenshot CreateScreenshot(DataSet dataSet, byte[] data)

public Screenshot<TAsset> CreateScreenshot<TAsset>(ScreenshotsLibrary<TAsset> library, byte[] data, DateTime creationDate) where TAsset : Asset
{
var screenshot = library.AddScreenshot(creationDate, out var removedScreenshots);
var screenshot = library.CreateScreenshot(creationDate, out var removedScreenshots);
foreach (var removedScreenshot in removedScreenshots)
DeleteScreenshotData(removedScreenshot);
SaveScreenshotData(screenshot, data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private void AddScreenshots(Domain.Model.DataSets.Classifier.ClassifierDataSet d
{
foreach (var rawScreenshot in screenshots)
{
var screenshot = dataSet.Screenshots.AddScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
var screenshot = dataSet.Screenshots.CreateScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
Guard.IsTrue(removedScreenshots.IsEmpty);
session.Screenshots.Add(rawScreenshot.Id, screenshot);
_screenshotsDataAccess.AssociateId(screenshot, rawScreenshot.Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void AddScreenshots(Domain.Model.DataSets.Detector.DetectorDataSet dataS
{
foreach (var rawScreenshot in screenshots)
{
var screenshot = dataSet.Screenshots.AddScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
var screenshot = dataSet.Screenshots.CreateScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
Guard.IsTrue(removedScreenshots.IsEmpty);
session.Screenshots.Add(rawScreenshot.Id, screenshot);
_screenshotsDataAccess.AssociateId(screenshot, rawScreenshot.Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void CreateScreenshots(Domain.Model.DataSets.Poser2D.Poser2DDataSet data
{
foreach (var rawScreenshot in screenshots)
{
var screenshot = dataSet.Screenshots.AddScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
var screenshot = dataSet.Screenshots.CreateScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
Guard.IsTrue(removedScreenshots.IsEmpty);
session.Screenshots.Add(rawScreenshot.Id, screenshot);
_screenshotsDataAccess.AssociateId(screenshot, rawScreenshot.Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void CreateScreenshots(Domain.Model.DataSets.Poser3D.Poser3DDataSet data
{
foreach (var rawScreenshot in screenshots)
{
var screenshot = dataSet.Screenshots.AddScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
var screenshot = dataSet.Screenshots.CreateScreenshot(rawScreenshot.CreationDate, out var removedScreenshots);
Guard.IsTrue(removedScreenshots.IsEmpty);
session.Screenshots.Add(rawScreenshot.Id, screenshot);
_screenshotsDataAccess.AssociateId(screenshot, rawScreenshot.Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public void ShouldCreateAsset()
{
ClassifierDataSet dataSet = new();
dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
screenshot.Asset.Should().Be(asset);
dataSet.Assets.Should().Contain(asset);
Expand All @@ -21,7 +21,7 @@ public void ShouldNotCreateDuplicateAsset()
{
ClassifierDataSet dataSet = new();
dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => dataSet.Assets.MakeAsset(screenshot));
screenshot.Asset.Should().Be(asset);
Expand All @@ -34,7 +34,7 @@ public void ShouldDeleteAsset()
{
ClassifierDataSet dataSet = new();
dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
dataSet.Assets.DeleteAsset(asset);
dataSet.Assets.Should().BeEmpty();
Expand All @@ -47,7 +47,7 @@ public void ShouldNotDeleteAssetFromOtherDataSet()
ClassifierDataSet dataSet1 = new();
dataSet1.Tags.CreateTag("");
ClassifierDataSet dataSet2 = new();
var screenshot = dataSet1.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet1.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet1.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => dataSet2.Assets.DeleteAsset(asset));
asset.Screenshot.Asset.Should().Be(asset);
Expand All @@ -59,7 +59,7 @@ public void ShouldNotSetAssetTagToForeign()
ClassifierDataSet dataSet = new();
var properTag = dataSet.Tags.CreateTag("");
var foreignTag = new ClassifierDataSet().Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => asset.Tag = foreignTag);
asset.Tag.Should().Be(properTag);
Expand All @@ -69,7 +69,7 @@ public void ShouldNotSetAssetTagToForeign()
public void ShouldNotCreateAssetWithoutAvailableTags()
{
ClassifierDataSet dataSet = new();
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
Assert.ThrowsAny<Exception>(() => dataSet.Assets.MakeAsset(screenshot));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public void ShouldNotSetTagToForeign()
{
ClassifierDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.Tag.Should().Be(tag);
Assert.ThrowsAny<Exception>(() => asset.Tag = new ClassifierDataSet().Tags.CreateTag(""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ShouldNotDeleteTagWithAssociatedAsset()
{
ClassifierDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => dataSet.Tags.DeleteTag(tag));
dataSet.Tags.Should().Contain(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed class DetectorAssetLibraryTests
public void ShouldCreateAsset()
{
DetectorDataSet dataSet = new();
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
screenshot.Asset.Should().Be(asset);
dataSet.Assets.Should().Contain(asset);
Expand All @@ -19,7 +19,7 @@ public void ShouldCreateAsset()
public void ShouldNotCreateDuplicateAsset()
{
DetectorDataSet dataSet = new();
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => dataSet.Assets.MakeAsset(screenshot));
screenshot.Asset.Should().Be(asset);
Expand All @@ -31,7 +31,7 @@ public void ShouldNotCreateDuplicateAsset()
public void ShouldDeleteAsset()
{
DetectorDataSet dataSet = new();
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
dataSet.Assets.DeleteAsset(asset);
dataSet.Assets.Should().BeEmpty();
Expand All @@ -43,7 +43,7 @@ public void ShouldNotDeleteAssetFromOtherDataSet()
{
DetectorDataSet dataSet1 = new();
DetectorDataSet dataSet2 = new();
var screenshot = dataSet1.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet1.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet1.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => dataSet2.Assets.DeleteAsset(asset));
asset.Screenshot.Asset.Should().Be(asset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public void ShouldCreateItem()
{
DetectorDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
var item = asset.CreateItem(tag, new Bounding());
asset.Items.Should().Contain(item);
Expand All @@ -22,7 +22,7 @@ public void ShouldCreateMultipleItemsWithSameTag()
{
DetectorDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
var item1 = asset.CreateItem(tag, new Bounding(0, 0, 0.5, 0.5));
var item2 = asset.CreateItem(tag, new Bounding(0, 0, 1, 1));
Expand All @@ -35,7 +35,7 @@ public void ShouldCreateMultipleItemsWithSameBounding()
DetectorDataSet dataSet = new();
var tag1 = dataSet.Tags.CreateTag("1");
var tag2 = dataSet.Tags.CreateTag("2");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
var item1 = asset.CreateItem(tag1, new Bounding());
var item2 = asset.CreateItem(tag2, new Bounding());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ShouldNotDeleteTagWithItems()
{
DetectorDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.CreateItem(tag, new Bounding(0, 0, 1, 1));
Assert.ThrowsAny<Exception>(() => dataSet.Tags.DeleteTag(tag));
Expand All @@ -60,7 +60,7 @@ public void ShouldDeleteTagWithoutItems()
DetectorDataSet dataSet = new();
var tag1 = dataSet.Tags.CreateTag("1");
var tag2 = dataSet.Tags.CreateTag("2");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.CreateItem(tag1, new Bounding(0, 0, 1, 1));
dataSet.Tags.DeleteTag(tag2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public sealed class Poser2DAssetLibraryTests
public void ShouldCreateAsset()
{
Poser2DDataSet dataSet = new();
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
screenshot.Asset.Should().Be(asset);
dataSet.Assets.Should().Contain(asset);
Expand All @@ -19,7 +19,7 @@ public void ShouldCreateAsset()
public void ShouldNotCreateDuplicateAsset()
{
Poser2DDataSet dataSet = new();
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => dataSet.Assets.MakeAsset(screenshot));
screenshot.Asset.Should().Be(asset);
Expand All @@ -31,7 +31,7 @@ public void ShouldNotCreateDuplicateAsset()
public void ShouldDeleteAsset()
{
Poser2DDataSet dataSet = new();
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
dataSet.Assets.DeleteAsset(asset);
dataSet.Assets.Should().BeEmpty();
Expand All @@ -43,7 +43,7 @@ public void ShouldNotDeleteAssetFromOtherDataSet()
{
Poser2DDataSet dataSet1 = new();
Poser2DDataSet dataSet2 = new();
var screenshot = dataSet1.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet1.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet1.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => dataSet2.Assets.DeleteAsset(asset));
asset.Screenshot.Asset.Should().Be(asset);
Expand Down
10 changes: 5 additions & 5 deletions SightKeeper.Domain.Tests/DataSets/Poser2D/Poser2DAssetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void ShouldCreateItem()
{
Poser2DDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
var item = asset.CreateItem(tag, new Bounding(), [], []);
asset.Items.Should().Contain(item);
Expand All @@ -23,7 +23,7 @@ public void ShouldCreateMultipleItemsWithSameTag()
{
Poser2DDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
var item1 = asset.CreateItem(tag, new Bounding(0, 0, 0.5, 0.5), [], []);
var item2 = asset.CreateItem(tag, new Bounding(0, 0, 1, 1), [], []);
Expand All @@ -36,7 +36,7 @@ public void ShouldCreateMultipleItemsWithSameBounding()
Poser2DDataSet dataSet = new();
var tag1 = dataSet.Tags.CreateTag("1");
var tag2 = dataSet.Tags.CreateTag("2");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
var item1 = asset.CreateItem(tag1, new Bounding(), [], []);
var item2 = asset.CreateItem(tag2, new Bounding(), [], []);
Expand All @@ -50,7 +50,7 @@ public void ShouldCreateItemWithKeyPoints()
var tag = dataSet.Tags.CreateTag("");
tag.CreateKeyPoint("1");
tag.CreateKeyPoint("2");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
var item = asset.CreateItem(tag, new Bounding(), [new Vector2<double>(), new Vector2<double>()], []);
asset.Items.Should().Contain(item);
Expand All @@ -63,7 +63,7 @@ public void ShouldNotCreateItemWithNotEqualAmountOfKeyPoints()
var tag = dataSet.Tags.CreateTag("");
tag.CreateKeyPoint("1");
tag.CreateKeyPoint("2");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
Assert.ThrowsAny<Exception>(() => asset.CreateItem(tag, new Bounding(), [new Vector2<double>()], []));
asset.Items.Should().BeEmpty();
Expand Down
8 changes: 4 additions & 4 deletions SightKeeper.Domain.Tests/DataSets/Poser2D/Poser2DTagTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void ShouldNotAddNewPointToTagWithAssociatedItems()
{
Poser2DDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.CreateItem(tag, new Bounding(), [], []);
Assert.ThrowsAny<Exception>(() => tag.CreateKeyPoint(""));
Expand All @@ -46,7 +46,7 @@ public void ShouldNotDeletePointOfTagWithAssociatedItems()
Poser2DDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var keyPoint = tag.CreateKeyPoint("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.CreateItem(tag, new Bounding(), [new Vector2<double>()], []);
Assert.ThrowsAny<Exception>(() => tag.DeleteKeyPoint(keyPoint));
Expand All @@ -59,7 +59,7 @@ public void ShouldAddNewPointToTagWithoutAssociatedItems()
Poser2DDataSet dataSet = new();
var tag1 = dataSet.Tags.CreateTag("1");
var tag2 = dataSet.Tags.CreateTag("2");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.CreateItem(tag1, new Bounding(), [], []);
var keyPoint = tag2.CreateKeyPoint("");
Expand All @@ -74,7 +74,7 @@ public void ShouldDeletePointOfTagWithoutAssociatedItems()
var tag2 = dataSet.Tags.CreateTag("2");
var keyPoint1 = tag1.CreateKeyPoint("");
var keyPoint2 = tag2.CreateKeyPoint("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.CreateItem(tag1, new Bounding(), [new Vector2<double>()], []);
tag2.DeleteKeyPoint(keyPoint2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ShouldNotDeleteTagWithItems()
{
Poser2DDataSet dataSet = new();
var tag = dataSet.Tags.CreateTag("");
var screenshot = dataSet.Screenshots.AddScreenshot(DateTime.Now, out _);
var screenshot = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out _);
var asset = dataSet.Assets.MakeAsset(screenshot);
asset.CreateItem(tag, new Bounding(0, 0, 1, 1), [], []);
Assert.ThrowsAny<Exception>(() => dataSet.Tags.DeleteTag(tag));
Expand Down
12 changes: 6 additions & 6 deletions SightKeeper.Domain.Tests/DataSets/ScreenshotsLibraryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public void ShouldDeleteExceedScreenshot()
{
DetectorDataSet dataSet = new();
dataSet.Screenshots.MaxQuantity = 2;
var screenshot1 = dataSet.Screenshots.AddScreenshot(DateTime.Now, out var removedScreenshots);
var screenshot1 = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out var removedScreenshots);
removedScreenshots.Should().BeEmpty();
var screenshot2 = dataSet.Screenshots.AddScreenshot(DateTime.Now, out removedScreenshots);
var screenshot2 = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out removedScreenshots);
removedScreenshots.Should().BeEmpty();
var screenshot3 = dataSet.Screenshots.AddScreenshot(DateTime.Now, out removedScreenshots);
var screenshot3 = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out removedScreenshots);
removedScreenshots.Should().Contain(screenshot1);
dataSet.Screenshots.Should().NotContain(screenshot1);
dataSet.Screenshots.Should().ContainInOrder(screenshot2, screenshot3);
Expand All @@ -25,12 +25,12 @@ public void ShouldNotDeleteScreenshotWithAsset()
{
DetectorDataSet dataSet = new();
dataSet.Screenshots.MaxQuantity = 2;
var screenshot1 = dataSet.Screenshots.AddScreenshot(DateTime.Now, out var removedScreenshots);
var screenshot1 = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out var removedScreenshots);
removedScreenshots.Should().BeEmpty();
var screenshot2 = dataSet.Screenshots.AddScreenshot(DateTime.Now, out removedScreenshots);
var screenshot2 = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out removedScreenshots);
removedScreenshots.Should().BeEmpty();
dataSet.Assets.MakeAsset(screenshot2);
var screenshot3 = dataSet.Screenshots.AddScreenshot(DateTime.Now, out removedScreenshots);
var screenshot3 = dataSet.Screenshots.CreateScreenshot(DateTime.Now, out removedScreenshots);
removedScreenshots.Should().BeEmpty();
dataSet.Screenshots.Should().ContainInOrder(screenshot1, screenshot2, screenshot3);
}
Expand Down
Loading

0 comments on commit 7bae77d

Please sign in to comment.