예제 #1
0
        private DocInfo SetupForSavingTests()
        {
            doc.TargetDirectory = env;
            doc.DocType         = InfoType.Regular;

            if (File.Exists(doc.GetDestinationFile()))
            {
                File.Delete(doc.GetDestinationFile());
            }
            if (Directory.Exists(doc.GetDestinationFile()))
            {
                Directory.Delete(doc.GetDestination());
            }

            string yearpath  = doc.YearPath();
            string monthpath = doc.MonthPath();
            string daypath   = doc.DayPath();

            if (Directory.Exists(daypath))
            {
                Directory.Delete(daypath);
                Directory.Delete(monthpath);
                Directory.Delete(yearpath);
            }

            return(doc);
        }
예제 #2
0
        public void CreateDirectoryChainTest()
        {
            doc = SetupForSavingTests();

            string yearpath  = doc.YearPath();
            string monthpath = doc.MonthPath();
            string daypath   = doc.DayPath();


            string docpath = doc.CreatePath();


            Assert.IsTrue(Directory.Exists(yearpath));
            Assert.IsTrue(Directory.Exists(monthpath));
            Assert.IsTrue(Directory.Exists(daypath));
        }