コード例 #1
0
ファイル: InitTests.cs プロジェクト: lastunicorn/ProjArchiver
        public void throws_if_ProjectDirectory_is_empty_string()
        {
            archiver.ArchivesDirectoryFullPath = @"c:\path\to\archives";
            archiver.ProjectDirectoryFullPath  = string.Empty;

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

            Assert.Equal(Resources.Err_ProjectDirectoryNotSpecified, exception.Message);
        }
コード例 #2
0
ファイル: InitTests.cs プロジェクト: lastunicorn/ProjArchiver
        public void throws_if_ArchivesDirectory_is_null()
        {
            archiver.ArchivesDirectoryFullPath = null;
            archiver.ProjectDirectoryFullPath  = @"c:\path\to\projects\MyProject";

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

            Assert.Equal(Resources.Err_ArchivesDirectoryNotSpecified, exception.Message);
        }
コード例 #3
0
        public void throws_if_ArchivesDirectoryFullPath_is_empty_string()
        {
            restorer.ArchivesDirectoryFullPath = string.Empty;
            restorer.WorkDirectoryFullPath     = @"c:\path\to\projects";
            restorer.ProjectName = "MyProject";

            ProjArchiveException exception = Assert.Throws <ProjArchiveException>(() => restorer.Restore());

            Assert.Equal(Resources.Err_ArchivesDirectoryNotSpecified, exception.Message);
        }
コード例 #4
0
        public void throws_if_ProjectName_is_null()
        {
            restorer.ArchivesDirectoryFullPath = @"c:\path\to\archives";
            restorer.WorkDirectoryFullPath     = @"c:\path\to\projects";
            restorer.ProjectName = null;

            ProjArchiveException exception = Assert.Throws <ProjArchiveException>(() => restorer.Restore());

            Assert.Equal(Resources.Err_ProjectNameNotSpecified, exception.Message);
        }
コード例 #5
0
        public void throws_if_ProjectArchiveFile_already_exists()
        {
            storage.Setup(x => x.OpenFileToWrite(It.IsAny <string>())).Returns(Stream.Null);
            storage.Setup(x => x.ExistsFile(@"d:\Archives\MyProject\MyProject.zip")).Returns(true);
            archiver.ArchivesDirectoryFullPath = @"d:\Archives";
            archiver.ProjectDirectoryFullPath  = @"d:\Projects\MyProject";

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

            Assert.Equal(DustInTheWind.ProjArchiver.Properties.Resources.Err_ArchiveAlreadyExists, exception.Message);
        }
コード例 #6
0
        public void throws_if_project_directory_exists()
        {
            storage.Setup(x => x.ExistsDirectory(@"c:\path\to\projects\MyProject"))
            .Returns(true);
            restorer.ArchivesDirectoryFullPath = @"c:\path\to\archives";
            restorer.WorkDirectoryFullPath     = @"c:\path\to\projects";
            restorer.ProjectName = "MyProject";

            ProjArchiveException exception = Assert.Throws <ProjArchiveException>(() => restorer.Restore());

            Assert.Equal(Resources.Err_ProjectAlreadyExists, exception.Message);
        }