Пример #1
0
        /// <summary>
        /// Deletes the locally created test folder.
        /// </summary>
        public virtual void DeleteLocalTestDirectory()
        {
            if (LocalTestRoot.Exists)
            {
                LocalTestRoot.Delete(true);
            }

            if (DownloadFile0Template != null)
            {
                DownloadFile0Template.Refresh();
            }
            if (DownloadFile1Template != null)
            {
                DownloadFile1Template.Refresh();
            }
        }
Пример #2
0
        /// <summary>
        /// Writes the two test files to the <see cref="LocalTestRoot"/>
        /// directory.
        /// </summary>
        protected virtual void CreateLocalTestFiles()
        {
            Random rnd = new Random();

            //file0 - 2MB
            var data0 = new byte[1024 * 1024 * 2];

            rnd.NextBytes(data0);
            File.WriteAllBytes(DownloadFile0Template.FullName, data0);
            DownloadFile0Template.Refresh();

            //file1 - 4MB
            var data1 = new byte[1024 * 1024 * 4];

            rnd.NextBytes(data1);
            File.WriteAllBytes(DownloadFile1Template.FullName, data1);
            DownloadFile1Template.Refresh();
        }