public void Dispose_Twice() { using var stream = File.OpenRead("video.h264"); var decoder = new H264Decoder(stream); decoder.Dispose(); decoder.Dispose(); }
public void Disposed_ThrowsException() { var decoder = new H264Decoder(Stream.Null); decoder.Dispose(); Assert.Throws <ObjectDisposedException>(() => decoder.Start()); Assert.Throws <ObjectDisposedException>(() => decoder.FrameBuffer.CopyFramebuffer(Array.Empty <byte>())); Assert.Throws <ObjectDisposedException>(() => decoder.Decode()); }