AeroFSSDK.Tests.TestDownloadFile.ShouldDownloadFile C# (CSharp) Метод

ShouldDownloadFile() приватный Метод

private ShouldDownloadFile ( ) : void
Результат void
        public void ShouldDownloadFile()
        {
            var f = Encoding.ASCII.GetBytes(new string('x', 1048576));

            using (var fileContents = new MemoryStream(f))
            {
                var parent = Client.CreateFolder(FolderID.Root, "ParentFolder").ID;
                var file = Client.CreateFile(parent, "DownloadFileTest").ID;

                var progress = Client.StartUpload(file, fileContents);

                while (!progress.EOFReached)
                {
                    progress = Client.UploadContent(file, progress, fileContents);
                }
                Client.FinishUpload(file, progress);

                using (var downloadContents = Client.DownloadFileContent(file))
                {
                    fileContents.Seek(0, SeekOrigin.Begin);

                    int b1 = downloadContents.ReadByte(), b2 = fileContents.ReadByte();
                    do
                    {
                        Assert.AreEqual(b1, b2);
                        b1 = downloadContents.ReadByte();
                        b2 = fileContents.ReadByte();
                    } while (b1 != -1 && b2 != -1);
                }
            }
        }
TestDownloadFile