Ejemplo n.º 1
0
        public void Uncompress_Should_Throw_If_FilePath_Is_Null()
        {
            // Given
            var fileSystem  = Substitute.For <IFileSystem>();
            var environment = Substitute.For <ICakeEnvironment>();
            var log         = Substitute.For <ICakeLog>();
            var zip         = new BZip2(fileSystem, environment, log);

            // Then
            Assert.That(() => zip.Uncompress(null, "/Uncompress"),
                        Throws.InstanceOf <ArgumentNullException>()
                        .And.Property("ParamName").EqualTo("filePath"));
        }
Ejemplo n.º 2
0
        public void Uncompress_Should_Throw_If_OutputPath_Is_Null()
        {
            // Given
            var filePath    = "/archive.tar.bz2";
            var environment = FakeEnvironment.CreateUnixEnvironment();
            var fileSystem  = new FakeFileSystem(environment);

            fileSystem.CreateFile(filePath);
            var log = Substitute.For <ICakeLog>();
            var zip = new BZip2(fileSystem, environment, log);

            // Then
            Assert.That(() => zip.Uncompress(filePath, null),
                        Throws.InstanceOf <ArgumentNullException>()
                        .And.Property("ParamName").EqualTo("outputPath"));
        }