mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +00:00
Changes the way the exception is verified
This commit is contained in:
@@ -188,6 +188,25 @@ public class RepositoriesClientTests
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ThrowsInvalidGitIgnoreExceptionForInvalidTemplateNames()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
var repoName = Helper.MakeNameWithTimestamp("repo-with-gitignore");
|
||||
|
||||
var newRepository = new NewRepository(repoName)
|
||||
{
|
||||
AutoInit = true,
|
||||
GitignoreTemplate = "visualstudio"
|
||||
};
|
||||
|
||||
var thrown = await Assert.ThrowsAsync<InvalidGitIgnoreTemplateException>(
|
||||
() => github.CreateRepositoryContext(newRepository));
|
||||
|
||||
Assert.NotNull(thrown);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ThrowsRepositoryExistsExceptionForExistingRepository()
|
||||
{
|
||||
|
||||
@@ -117,10 +117,7 @@ namespace Octokit
|
||||
throw new PrivateRepositoryQuotaExceededException(e);
|
||||
}
|
||||
|
||||
if (String.Equals(
|
||||
"gitignore_template is an unknown gitignore template.",
|
||||
errorMessage,
|
||||
StringComparison.OrdinalIgnoreCase))
|
||||
if (errorMessage.EndsWith("is an unknown gitignore template.", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new InvalidGitIgnoreTemplateException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user