Changes the way the exception is verified

This commit is contained in:
William Barbosa
2015-10-08 20:38:18 -03:00
parent 7dee540afd
commit 64326519ee
2 changed files with 20 additions and 4 deletions
@@ -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()
{
+1 -4
View File
@@ -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);
}