Пример #1
0
        public static void TestPut(IRemoteFileFetcher fetcher, string url, string username, string password)
        {
            byte[] buffer;
            string fileHash;

            CreateTempFile(out buffer, out fileHash);

            fetcher.PutFromTemporaryFile(fileHash, url, username, password);
        }
Пример #2
0
        public static void TestPutGet(IRemoteFileFetcher fetcher, string url, string username, string password)
        {
            byte[] buffer;
            string fileHash;

            CreateTempFile(out buffer, out fileHash);

            // Put
            fetcher.PutFromTemporaryFile(fileHash, url, username, password);

            // Get
            var fetchedHash = fetcher.GetToTemporaryFile(url, username, password);

            using (var fetchedMs = FileRepositoryHelper.GetTemporaryFileDataStream(fetchedHash))
            {
                var b = fetchedMs.ReadByte();

                buffer[0].ShouldBeEquivalentTo(b);
            }
            //TODO: Delete the file
        }