public void RemoveFrame_CanRemoveFrameZeroIfMultipleFramesExist() { var collection = new ImageFrameCollection <Rgba32>(new[] { new ImageFrame <Rgba32>(10, 10), new ImageFrame <Rgba32>(10, 10), }); collection.Remove(collection[0]); Assert.Equal(1, collection.Count); }
public void RemoveFrame_ThrowIfRemovingLastFrame() { var collection = new ImageFrameCollection <Rgba32>(new[] { new ImageFrame <Rgba32>(10, 10) }); InvalidOperationException ex = Assert.Throws <InvalidOperationException>(() => { collection.Remove(collection[0]); }); Assert.Equal("Cannot remove last frame.", ex.Message); }