Exemple #1
0
        public void CanFetchFromRemoteRepository()
        {
            var remotePath = CloneTestRepository(_fixture.PopulatedRepositoryPath);
            var localPath  = CloneTestRepository(remotePath);

            File.WriteAllLines(Path.Combine(remotePath, "new.txt"), new [] { "Hello", "World" });
            var remoteWrapper = new Git.GitWrapper(remotePath);
            var localWrapper  = new Git.GitWrapper(localPath);

            Assert.True(remoteWrapper.AddAll().Result.Success);
            Assert.True(remoteWrapper.Commit("Added a file").Result.Success);
            var fetchResult = localWrapper.Fetch().Result;

            Assert.True(fetchResult.Success);
            Assert.Contains("master", fetchResult.UpdatedBranches);
        }