Exemplo n.º 1
0
        public void ShouldBeAbleToFilterFilesByAddingARegularExpressionShowingFilesToInclude()
        {
            var location = new Location(TestDirectory, "desc")
                               {
                                   IncludedExpressions = new []
                                                             {
                                                                 ".*e3.*"
                                                             }
                               };

            Assert.AreEqual(13, location.GetFiles().Count());
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
0
        public void ShouldBeAbleToFilterFilesByUsingAEndingDate()
        {
            ResetTestFiles();
            foreach (var file in TestDirectory.GetFiles("*.*").Take(3))
            {
                file.LastWriteTimeUtc = new DateTime(2012, 01, 01);
            }

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

            Assert.AreEqual(36, location.GetFiles().Count());
        }
Exemplo n.º 4
0
        public void ShouldBeAbleToGetAllFiles()
        {
            var location = new Location(TestDirectory, "desc");

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