BloomTests.WebLibraryIntegration.BloomS3StandardUpDownloadTests.SetupFixture C# (CSharp) Method

SetupFixture() private method

private SetupFixture ( ) : void
return void
        public void SetupFixture()
        {
            // Basic setup
            _workFolder = new TemporaryFolder("unittest2");
            var workFolderPath = _workFolder.FolderPath;
            Assert.AreEqual(0, Directory.GetDirectories(workFolderPath).Count(), "Some stuff was left over from a previous test");

            _client = new BloomS3Client(BloomS3Client.UnitTestBucketName);

            // Now do standard upload/download. We save time by making this whole class do one upload/download sequence
            // on the assumption that things that should be uploaded were if they make it through the download process too.
            // Individual tests just compare what was uploaded with what came back through the download.
            // If we want to upload and download to separate (collection) folders, we need another layer for the actual book

            _storageKeyOfBookFolder = Guid.NewGuid().ToString();

            // First create folder to upload from
            var unittestGuid = Guid.NewGuid();
            var srcFolder = new TemporaryFolder(_workFolder, "unittest-src-" + unittestGuid);
            _srcCollectionPath = srcFolder.FolderPath;

            // Then create standard book
            var book = MakeBookIncludingThumbs(srcFolder);

            // Upload standard book
            UploadBook(book);

            // Create folder to download to
            var destFolder = new TemporaryFolder(_workFolder, "unittest-dest-" + unittestGuid);
            _destCollectionPath = destFolder.FolderPath;

            // Download standard book
            DownloadBook();
        }