예제 #1
0
        public void ShouldBeAbleToFilterFilesByUsingABeginningDate()
        {
            ResetTestFiles();
            foreach (var file in TestDirectory.GetFiles("*.*").Take(3))
            {
                file.LastWriteTimeUtc = new DateTime(2012, 01, 01);
            }

            var location = new Location(TestDirectory, "desc") {BeginningDate = new DateTime(2011, 01, 01)};

            Assert.AreEqual(3, location.GetFiles().Count());
        }
예제 #2
0
        public void ShouldBeAbleToFilterFilesByAddingARegularExpressionShowingFilesToInclude()
        {
            var location = new Location(TestDirectory, "desc")
                               {
                                   IncludedExpressions = new []
                                                             {
                                                                 ".*e3.*"
                                                             }
                               };

            Assert.AreEqual(13, location.GetFiles().Count());
        }
예제 #3
0
        public void ShouldCreateAnArchive()
        {
            var location = new Location(TestDirectory, "desc");

            var archive = new Archive();

            var archiveFilename = Archive.GetArchiveName(
                String.Format("{0}-should-create-an-archive-test", CurrentDirectory.FullName),
                DateTime.Now);

            archive.Compress(archiveFilename, location.GetFiles());

            var archiveFile = new FileInfo(archiveFilename);

            Assert.IsTrue(archiveFile.Exists, String.Format("{0} does not exist.", archiveFile.FullName));
        }
예제 #4
0
        public void ShouldBeAbleToGetAllFiles()
        {
            var location = new Location(TestDirectory, "desc");

            Assert.AreEqual(39, location.GetFiles().Count());
        }