adjusting exception message to not rely on credentials

This commit is contained in:
Brendan Forster
2014-04-30 13:25:14 +08:00
parent 68384f778b
commit ac89fe07da
4 changed files with 41 additions and 7 deletions

View File

@@ -0,0 +1,36 @@
using Xunit;
namespace Octokit.Tests.Exceptions
{
public class RepositoryExistsExceptionTests
{
public class TheMessageProperty
{
[Fact]
public void WhenOwnerIsNullDoNotMentionInMessage()
{
var exception = new RepositoryExistsException(
null,
"some-repo",
false,
GitHubClient.GitHubDotComUrl,
new ApiValidationException());
Assert.Equal("There is already a repository named 'some-repo' for the current account.", exception.Message);
}
[Fact]
public void WhenOwnerIsNotNullMentionInMessage()
{
var exception = new RepositoryExistsException(
"some-org",
"some-repo",
true,
GitHubClient.GitHubDotComUrl,
new ApiValidationException());
Assert.Equal("There is already a repository named 'some-repo' in the organization 'some-org'.", exception.Message);
}
}
}
}