Fixed a couple more tests

We don't need to await tests of argument validation. But we do need to
await tests that test exceptions returned from a task.
This commit is contained in:
Haacked
2014-03-21 11:22:05 -07:00
parent b56613b99b
commit 90edfa65a6
2 changed files with 6 additions and 7 deletions
@@ -242,12 +242,12 @@ public class IssuesClientTests : IDisposable
{
var owner = _repository.Owner.Login;
AssertEx.Throws<ApiValidationException>(
() => _issuesClient.GetForRepository(owner, _repository.Name,
await AssertEx.Throws<ApiValidationException>(
async () => await _issuesClient.GetForRepository(owner, _repository.Name,
new RepositoryIssueRequest { Creator = "some-random-account" }));
AssertEx.Throws<ApiValidationException>(
() => _issuesClient.GetForRepository(owner, _repository.Name,
await AssertEx.Throws<ApiValidationException>(
async () => await _issuesClient.GetForRepository(owner, _repository.Name,
new RepositoryIssueRequest { Assignee = "some-random-account" }));
}
+2 -3
View File
@@ -163,8 +163,7 @@ public class GistsClientTests
var connection = Substitute.For<IApiConnection>();
var client = new GistsClient(connection);
AssertEx.Throws<ArgumentNullException>(async () => await
client.Delete(null));
Assert.Throws<ArgumentNullException>(() => client.Delete(null));
}
}
@@ -224,7 +223,7 @@ public class GistsClientTests
var client = new GistsClient(apiConnection);
AssertEx.Throws<ApiException>(async () => await client.IsStarred("1"));
await AssertEx.Throws<ApiException>(async () => await client.IsStarred("1"));
}
}