예제 #1
0
 public static bool     delete_Repository_And_Files(this API_NGit nGit)
 {
     if (nGit.delete_Repository())
     {
         return(Files.deleteFolder(nGit.Path_Local_Repository, true));
     }
     return(false);
 }
예제 #2
0
        public void delete_Repository_And_Files()
        {
            var localRepo = "localRepo".tempDir();
            var nGit_Repo = localRepo.git_Init();

            nGit_Repo.file_Create_Random_File();
            nGit_Repo.add_and_Commit_using_Status();

            nGit_Repo.delete_Repository_And_Files();

            Assert.IsFalse(localRepo.isGitRepository());
            Assert.IsFalse(localRepo.dirExists());


            //check exceptions
            Assert.IsFalse((null as API_NGit).delete_Repository_And_Files());
            Assert.IsFalse((null as API_NGit).delete_Repository());
            var badNGitObject = new API_NGit {
                Path_Local_Repository = localRepo
            };

            Assert.IsFalse(badNGitObject.delete_Repository());
        }