From a00ba3b993dbe46d00ba514f6bfa93f1e92c3f83 Mon Sep 17 00:00:00 2001 From: Kristian Hald Date: Mon, 20 Apr 2015 21:55:07 +0200 Subject: [PATCH] Changed 'await AssertEx.Throws' to 'Assert.ThrowsAsync'. --- .../Clients/RepositoryForksClientTests.cs | 10 +++--- .../Clients/RepositoryHooksClientTest.cs | 32 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Octokit.Tests/Clients/RepositoryForksClientTests.cs b/Octokit.Tests/Clients/RepositoryForksClientTests.cs index 8503fc8e..5247d809 100644 --- a/Octokit.Tests/Clients/RepositoryForksClientTests.cs +++ b/Octokit.Tests/Clients/RepositoryForksClientTests.cs @@ -40,8 +40,8 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Forks.GetAll(null, "name", null)); - await AssertEx.Throws(async () => await client.Forks.GetAll("owner", null, null)); + Assert.ThrowsAsync(async () => await client.Forks.GetAll(null, "name", null)); + Assert.ThrowsAsync(async () => await client.Forks.GetAll("owner", null, null)); } } @@ -64,9 +64,9 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Forks.Create(null, "name", new NewRepositoryFork())); - await AssertEx.Throws(async () => await client.Forks.Create("owner", null, new NewRepositoryFork())); - await AssertEx.Throws(async () => await client.Forks.Create("owner", "name", null)); + Assert.ThrowsAsync(async () => await client.Forks.Create(null, "name", new NewRepositoryFork())); + Assert.ThrowsAsync(async () => await client.Forks.Create("owner", null, new NewRepositoryFork())); + Assert.ThrowsAsync(async () => await client.Forks.Create("owner", "name", null)); } [Fact] diff --git a/Octokit.Tests/Clients/RepositoryHooksClientTest.cs b/Octokit.Tests/Clients/RepositoryHooksClientTest.cs index 6ed139b8..38f0e9f6 100644 --- a/Octokit.Tests/Clients/RepositoryHooksClientTest.cs +++ b/Octokit.Tests/Clients/RepositoryHooksClientTest.cs @@ -26,8 +26,8 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Hooks.GetAll(null, "name")); - await AssertEx.Throws(async () => await client.Hooks.GetAll("owner", null)); + Assert.ThrowsAsync(async () => await client.Hooks.GetAll(null, "name")); + Assert.ThrowsAsync(async () => await client.Hooks.GetAll("owner", null)); } } @@ -49,8 +49,8 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Hooks.Get(null, "name", 123)); - await AssertEx.Throws(async () => await client.Hooks.Get("owner", null, 123)); + Assert.ThrowsAsync(async () => await client.Hooks.Get(null, "name", 123)); + Assert.ThrowsAsync(async () => await client.Hooks.Get("owner", null, 123)); } } @@ -73,9 +73,9 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Hooks.Create(null, "name", new NewRepositoryHook("name", new { config = "" }))); - await AssertEx.Throws(async () => await client.Hooks.Create("owner", null, new NewRepositoryHook("name", new { config = "" }))); - await AssertEx.Throws(async () => await client.Hooks.Create("owner", "name", null)); + Assert.ThrowsAsync(async () => await client.Hooks.Create(null, "name", new NewRepositoryHook("name", new { config = "" }))); + Assert.ThrowsAsync(async () => await client.Hooks.Create("owner", null, new NewRepositoryHook("name", new { config = "" }))); + Assert.ThrowsAsync(async () => await client.Hooks.Create("owner", "name", null)); } [Fact] @@ -110,9 +110,9 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Hooks.Edit(null, "name", 12345678, new EditRepositoryHook())); - await AssertEx.Throws(async () => await client.Hooks.Edit("owner", null, 12345678, new EditRepositoryHook())); - await AssertEx.Throws(async () => await client.Hooks.Edit("owner", "name", 12345678, null)); + Assert.ThrowsAsync(async () => await client.Hooks.Edit(null, "name", 12345678, new EditRepositoryHook())); + Assert.ThrowsAsync(async () => await client.Hooks.Edit("owner", null, 12345678, new EditRepositoryHook())); + Assert.ThrowsAsync(async () => await client.Hooks.Edit("owner", "name", 12345678, null)); } [Fact] @@ -146,8 +146,8 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Hooks.Test(null, "name", 12345678)); - await AssertEx.Throws(async () => await client.Hooks.Test("owner", null, 12345678)); + Assert.ThrowsAsync(async () => await client.Hooks.Test(null, "name", 12345678)); + Assert.ThrowsAsync(async () => await client.Hooks.Test("owner", null, 12345678)); } } @@ -158,8 +158,8 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Hooks.Ping(null, "name", 12345678)); - await AssertEx.Throws(async () => await client.Hooks.Ping("owner", null, 12345678)); + Assert.ThrowsAsync(async () => await client.Hooks.Ping(null, "name", 12345678)); + Assert.ThrowsAsync(async () => await client.Hooks.Ping("owner", null, 12345678)); } [Fact] @@ -192,8 +192,8 @@ namespace Octokit.Tests.Clients { var client = new RepositoriesClient(Substitute.For()); - await AssertEx.Throws(async () => await client.Hooks.Delete(null, "name", 12345678)); - await AssertEx.Throws(async () => await client.Hooks.Delete("owner", null, 12345678)); + Assert.ThrowsAsync(async () => await client.Hooks.Delete(null, "name", 12345678)); + Assert.ThrowsAsync(async () => await client.Hooks.Delete("owner", null, 12345678)); } } }