public async Task Integration_VimeoClient_UploadEntireFile_UploadsFile_ReadPartOfFile() { using (var file = new BinaryContent(GetFileFromEmbeddedResources(Testfilepath), "video/mp4")) { (await file.ReadAsync(17, 20)).Length.ShouldBe(3); (await file.ReadAsync(17000, 17020)).Length.ShouldBe(20); } }
public async Task ShouldCorrectlyReadPartOfFile() { using (var file = new BinaryContent(TestHelper.GetFileFromEmbeddedResources(TestHelper.TestFilePath), "video/mp4")) { (await file.ReadAsync(17, 20)).Length.ShouldBe(3); (await file.ReadAsync(17000, 17020)).Length.ShouldBe(20); } }
public void Integration_VimeoClient_UploadEntireFile_UploadsFile_InvalidStreams() { var nonReadablefile = new BinaryContent(new NonReadableStream(), "video/mp4"); var nonSeekablefile = new BinaryContent(new NonSeekableStream(), "video/mp4"); Should.ThrowAsync <InvalidOperationException>(async() => await nonReadablefile.ReadAllAsync(), "Content should be a readable Stream"); Should.ThrowAsync <InvalidOperationException>(async() => await nonSeekablefile.ReadAsync(10, 20), "Content cannot be advanced to the specified start index: 10"); }