public Clone ( string remotePathOrUrl, string workingDirectory ) : IRepository | ||
remotePathOrUrl | string | |
workingDirectory | string | |
리턴 | IRepository |
public void CloneCreatesLocalRepo() { //Assert.Inconclusive("This test accesses file system."); //arrange var project = new Mock<VBProject>(); var expected = new Repository("SourceControlTest", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "SourceControlTest"), @"https://github.com/ckuhn203/SourceControlTest.git" ); var git = new GitProvider(project.Object); //act var actual = git.Clone(expected.RemoteLocation, expected.LocalLocation); //assert Assert.AreEqual(expected.Name, actual.Name); Assert.AreEqual(expected.LocalLocation, actual.LocalLocation); Assert.AreEqual(expected.RemoteLocation, actual.RemoteLocation); Assert.IsTrue(Directory.Exists(Path.Combine(expected.LocalLocation, ".git"))); }
public void CreateBranchTest() { //Assert.Inconclusive("This test accesses file system."); var project = new Mock<VBProject>(); var repo = new Repository("SourceControlTest", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "SourceControlTest"), @"https://github.com/ckuhn203/SourceControlTest.git" ); var git = new GitProvider(project.Object); git = new GitProvider(project.Object, git.Clone(repo.RemoteLocation, repo.LocalLocation), new CodePaneWrapperFactory()); git.CreateBranch("NewBranch"); Assert.AreEqual("NewBranch", git.CurrentBranch); }