mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-23 23:55:13 +00:00
adjusting exception message to not rely on credentials
This commit is contained in:
36
Octokit.Tests/Exceptions/RepositoryExistsExceptionTests.cs
Normal file
36
Octokit.Tests/Exceptions/RepositoryExistsExceptionTests.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user