public void FactoryOfTableSheets_IntegrationTest()
        {
            IOfficeMaker tableSheetFactory = new TableSheetFactory(testWorkbook);
            int initialSheetCount = testWorkbook.sheetCount;

            // Should Not Return Anything; Should just add sheets to workbook
            tableSheetFactory.ExecuteMake(); //First Test
            Sheet tableSheet = testWorkbook.RecentlyAddedSheet;

            Assert.That(testWorkbook.sheetCount, Is.EqualTo(initialSheetCount + 1));
            Assert.That(tableSheet.Writer, Is.TypeOf(typeof(AqtestTableWriter)));
            Assert.That(tableSheet.EmbedTool, Is.TypeOf(typeof(TableEmbedder)));

            SheetFactory linkSheetFactory = new LinkSheetFactory(testWorkbook, Directory.GetCurrentDirectory());
            linkSheetFactory.ExecuteCopy();
            Sheet linkSheet = testWorkbook.RecentlyAddedSheet;

            Assert.That(testWorkbook.sheetCount, Is.EqualTo(initialSheetCount + 2));
            Assert.That(linkSheet.Writer, Is.TypeOf(typeof(DirectoryLinkWriter)));
            Assert.That(linkSheet.EmbedTool, Is.TypeOf(typeof(LinkEmbedder)));
            Assert.That(linkSheet.wbPath, Is.EqualTo(tableSheet.wbPath));
        }
Exemplo n.º 2
0
 private void SetupTestFactory()
 {
     // Current Directory is C:\Users\jpinkard\Documents\GitHub\SolutionsForWork\FileLinkTracker\ExcelSharpTests\bin\Debug
     testFactory = new LinkSheetFactory(testWorkbook, Directory.GetCurrentDirectory());
 }
Exemplo n.º 3
0
 private DirectoryLinkWriter SetupSolutionDirectoryWriter()
 {
     string relativeSolutionDirectory = "../../../.";
     testFactory = new LinkSheetFactory(testWorkbook, relativeSolutionDirectory);
     linkSheet = testFactory.ExecuteMake() as Sheet;
     return linkSheet.Writer as DirectoryLinkWriter;
 }
        public void GenerateLinksCommand_IntegrationTest()
        {
            // Set up Sheet with Current Directory
            LinkSheetFactory linkSheetFactory = new LinkSheetFactory(testWorkbook, Directory.GetCurrentDirectory());
            Sheet CurrentDirectorySheet = linkSheetFactory.ExecuteMake() as Sheet;

            // Set up Sheet with Solution Directory
            string solutionRelativePath = "../../../.";
            linkSheetFactory.DirectoryPath = solutionRelativePath;
            Sheet SolutionDirectorySheet = linkSheetFactory.ExecuteMake() as Sheet;

            DateTime testDate = new DateTime(2014, 5, 21);

            WorkbookCommand generateWorkbookLinks = new HyperlinksByDateCommand(testWorkbook, testDate);
            generateWorkbookLinks.Execute();

            WriterAssertions(CurrentDirectorySheet, testDate, Directory.GetCurrentDirectory());
            WriterAssertions(SolutionDirectorySheet, testDate, solutionRelativePath);
        }