public void GitClone_ThrowNameConflictException() { var uri = new Uri(Environment.CurrentDirectory); var repositoryAddress = ""; _gitRepositoryAccess = new GitRepositoryAccess(uri); Action testCode = () => _gitRepositoryAccess.Clone(repositoryAddress); Assert.Throws <NameConflictException>(testCode); }
public void GitClone_Clone_OK() { var testDirectoryPath = Environment.CurrentDirectory + $"\\{Guid.NewGuid().ToString()}"; Directory.CreateDirectory(testDirectoryPath); var uri = new Uri(testDirectoryPath); var repositoryAddress = "https://github.com/programistadoswiadczony/PythonWebApi.git"; _gitRepositoryAccess = new GitRepositoryAccess(uri); //act _gitRepositoryAccess.Clone(repositoryAddress); Assert.True(Directory.GetFiles(testDirectoryPath).Any()); }
public void GtiCheckout_CheckoutProperBranch_OK() { var testDirectoryPath = Environment.CurrentDirectory + $"\\{Guid.NewGuid().ToString()}"; Directory.CreateDirectory(testDirectoryPath); var uri = new Uri(testDirectoryPath); var repositoryAddress = "https://github.com/programistadoswiadczony/PythonWebApi.git"; _gitRepositoryAccess = new GitRepositoryAccess(uri); _gitRepositoryAccess.Clone(repositoryAddress); var branchName = "master"; //act _gitRepositoryAccess.Checkout(branchName); Assert.NotNull(_gitRepositoryAccess.CheckoutedBranch); Assert.Equal("HEAD", _gitRepositoryAccess.CheckoutedBranch.Reference.CanonicalName); }