Browse Source

Fixed couple of invalid tests for ImageFrameCollection<TPixel>

pull/1629/head
Dmitry Pentin 5 years ago
parent
commit
f0f0c088ab
  1. 5
      tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs

5
tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs

@ -279,13 +279,14 @@ namespace SixLabors.ImageSharp.Tests
{
var image = new Image<Rgba32>(Configuration.Default, 10, 10);
var frameCollection = image.Frames;
var rgba32Array = new Rgba32[0];
image.Dispose(); // this should invalidate underlying collection as well
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.AddFrame((ImageFrame)null); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.AddFrame((Rgba32[])null); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.AddFrame(rgba32Array); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.AddFrame((ImageFrame<Rgba32>)null); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.AddFrame(stackalloc Rgba32[0]); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.AddFrame(rgba32Array.AsSpan()); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.CloneFrame(default); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.Contains(default); });
Assert.Throws<ObjectDisposedException>(() => { var res = frameCollection.CreateFrame(); });

Loading…
Cancel
Save