Пример #1
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);
        }