예제 #1
0
        public void ShouldReturnAnArchiveName()
        {
            var dateTime = new DateTime(2013, 6, 4, 12, 33, 22);
            var archive = new Archive();

            const string expected = "base-filename-2013-06-04.12.33.22.zip";
            Assert.AreEqual(expected, Archive.GetArchiveName("base-filename", dateTime));
        }
예제 #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));
        }