Ejemplo n.º 1
0
        public void throws_if_ArchivesDirectory_is_null()
        {
            archiver.ArchivesDirectoryFullPath = null;
            archiver.ProjectDirectoryFullPath  = @"c:\path\to\projects\MyProject";

            ProjArchiveException exception = Assert.Throws <ProjArchiveException>(() => archiver.Archive());

            Assert.Equal(Resources.Err_ArchivesDirectoryNotSpecified, exception.Message);
        }
Ejemplo n.º 2
0
        public void GivenTwoFilesThatExist_WhenArchive_ThenCreatedArchiveWithContent()
        {
            var fileNames       = new[] { "file1.bin", "file2.exe" };
            var archiveFileName = "archive";
            var fileContent     = Encoding.UTF8.GetBytes("content of file");

            A.CallTo(() => _fileSystem.ReadAllBytes(A <string> .Ignored))
            .Returns(fileContent);

            var archive = _archiver.Archive(fileNames.ToList(), archiveFileName);

            archive.Length.Should()
            .Be(fileContent.Length * 2 + Archiver.MetaBlockSizeBytes * 2 + Archiver.HeaderSizeBytes);
        }