Exemplo n.º 1
0
        public void SaveItem()
        {
            ExportStatus actualStatus = exporter.SaveItem(expectedFolderItem, expectedFolderItemFileName, true);

            exportWriterMock.Verify(e => e.Save(expectedFolderItemFileName, true));

            Assert.True(actualStatus.Success);
            Assert.AreEqual(expectedFolderItemFileName, actualStatus.ToPath);
            Assert.AreEqual(expectedFolderItem.Path, actualStatus.FromPath);
        }
        public void ExportFolderItem()
        {
            string filePath = outputPath + SSRSUtil.GetServerPathToPhysicalPath(folderItems[0].Path);

            ExportStatus actualStatus = exporter.SaveItem(folderItems[0], filePath);

            Assert.True(actualStatus.Success);
            Assert.AreEqual(filePath, actualStatus.ToPath);
            Assert.Null(actualStatus.Errors);
            Assert.True(Directory.Exists(actualStatus.ToPath));
        }
        public void ExportFolders()
        {
            reader.GetFolders("/SSRSMigrate_AW_Tests", GetFolders_Reporter);

            foreach (FolderItem actualFolderItem in actualFolderItems)
            {
                string saveFilePath = outputPath + SSRSUtil.GetServerPathToPhysicalPath(actualFolderItem.Path);

                ExportStatus actualStatus = folderExporter.SaveItem(
                    actualFolderItem,
                    saveFilePath,
                    true);

                // Export was successful
                Assert.True(actualStatus.Success, string.Format("Success; {0}", actualFolderItem.Path));

                // Exported to the expected location
                Assert.AreEqual(saveFilePath, actualStatus.ToPath, string.Format("ToPath; {0}", actualFolderItem.Path));

                // Was exported from the expected location
                Assert.AreEqual(actualFolderItem.Path, actualStatus.FromPath, string.Format("ToPath; {0}", actualFolderItem.Path));

                // The exported FolderItem exists on disk
                Assert.True(Directory.Exists(actualStatus.ToPath));
            }
        }