From b5e6ec1046c9a4d4ea1cf3426cf29ef745154835 Mon Sep 17 00:00:00 2001 From: Mordechai Zuber Date: Mon, 11 May 2015 17:27:00 +0300 Subject: [PATCH] CommitsClient ueses Assert.ThrowsAsync --- Octokit.Tests/Clients/CommitsClientTests.cs | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Octokit.Tests/Clients/CommitsClientTests.cs b/Octokit.Tests/Clients/CommitsClientTests.cs index 5d420cff..62a30f10 100644 --- a/Octokit.Tests/Clients/CommitsClientTests.cs +++ b/Octokit.Tests/Clients/CommitsClientTests.cs @@ -16,12 +16,12 @@ public class CommitsClientTests { var client = new CommitsClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Get(null, "name", "reference")); - await AssertEx.Throws(async () => await client.Get("owner", null, "reference")); - await AssertEx.Throws(async () => await client.Get("owner", "name", null)); - await AssertEx.Throws(async () => await client.Get("", "name", "reference")); - await AssertEx.Throws(async () => await client.Get("owner", "", "reference")); - await AssertEx.Throws(async () => await client.Get("owner", "name", "")); + await Assert.ThrowsAsync(() => client.Get(null, "name", "reference")); + await Assert.ThrowsAsync(() => client.Get("owner", null, "reference")); + await Assert.ThrowsAsync(() => client.Get("owner", "name", null)); + await Assert.ThrowsAsync(() => client.Get("", "name", "reference")); + await Assert.ThrowsAsync(() => client.Get("owner", "", "reference")); + await Assert.ThrowsAsync(() => client.Get("owner", "name", "")); } [Fact] @@ -60,11 +60,11 @@ public class CommitsClientTests var client = new CommitsClient(Substitute.For()); var newCommit = new NewCommit("message", "tree", new[]{"parent1", "parent2"}); - await AssertEx.Throws(async () => await client.Create(null, "name", newCommit)); - await AssertEx.Throws(async () => await client.Create("owner", null, newCommit)); - await AssertEx.Throws(async () => await client.Create("owner", "name", null)); - await AssertEx.Throws(async () => await client.Create("", "name", newCommit)); - await AssertEx.Throws(async () => await client.Create("owner", "", newCommit)); + await Assert.ThrowsAsync(() => client.Create(null, "name", newCommit)); + await Assert.ThrowsAsync(() => client.Create("owner", null, newCommit)); + await Assert.ThrowsAsync(() => client.Create("owner", "name", null)); + await Assert.ThrowsAsync(() => client.Create("", "name", newCommit)); + await Assert.ThrowsAsync(() => client.Create("owner", "", newCommit)); } }