AppHarbor.Tests.GitRepositoryConfigurerTest.ShouldThrowExceptionIfGitRemoteCantBeAdded C# (CSharp) Method

ShouldThrowExceptionIfGitRemoteCantBeAdded() private method

private ShouldThrowExceptionIfGitRemoteCantBeAdded ( [ gitCommand, GitRepositoryConfigurer repositoryConfigurer, string id, User user ) : void
gitCommand [
repositoryConfigurer GitRepositoryConfigurer
id string
user AppHarbor.Model.User
return void
        public void ShouldThrowExceptionIfGitRemoteCantBeAdded([Frozen]Mock<IGitCommand> gitCommand, GitRepositoryConfigurer repositoryConfigurer, string id, User user)
        {
            var repositoryUrl = GetRepositoryUrl(id, user);
            gitCommand.Setup(x => x.Execute(string.Format("remote add appharbor {0}", repositoryUrl))).Throws<GitCommandException>();

            var exception = Assert.Throws<RepositoryConfigurationException>(() => repositoryConfigurer.Configure(id, user));
            Assert.Equal(string.Format("Couldn't add appharbor repository as a git remote. Repository URL is: {0}.", repositoryUrl),
                exception.Message);
        }