public void Integration_VimeoClient_UploadEntireFile_UploadsFile_DisposedStreamAccess() { var file = new BinaryContent(GetFileFromEmbeddedResources(Testfilepath), "video/mp4"); file.Dispose(); Should.Throw <ObjectDisposedException>(() => file.Dispose()); Should.Throw <ObjectDisposedException>(() => file.Data.Length.ShouldBe(0)); Should.ThrowAsync <ObjectDisposedException>(async() => await file.ReadAllAsync()); }
public void ShouldFireExceptionWhenDisposedStreamAccess() { var file = new BinaryContent(TestHelper.GetFileFromEmbeddedResources(TestHelper.TestFilePath), "video/mp4"); file.Dispose(); Should.Throw <ObjectDisposedException>(() => file.Dispose()); Should.Throw <ObjectDisposedException>(() => file.Data.Length.ShouldBe(0)); Should.ThrowAsync <ObjectDisposedException>(async() => await file.ReadAllAsync()); }