public void ShouldBeAbleToFilterFilesByAddingARegularExpressionShowingFilesToInclude() { var location = new Location(TestDirectory, "desc") { IncludedExpressions = new [] { ".*e3.*" } }; Assert.AreEqual(13, location.GetFiles().Count()); }
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)); }
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()); }
public void ShouldBeAbleToGetAllFiles() { var location = new Location(TestDirectory, "desc"); Assert.AreEqual(39, location.GetFiles().Count()); }