mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
CommitsClient ueses Assert.ThrowsAsync
This commit is contained in:
@@ -16,12 +16,12 @@ public class CommitsClientTests
|
||||
{
|
||||
var client = new CommitsClient(Substitute.For<IApiConnection>());
|
||||
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.Get(null, "name", "reference"));
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.Get("owner", null, "reference"));
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.Get("owner", "name", null));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.Get("", "name", "reference"));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.Get("owner", "", "reference"));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.Get("owner", "name", ""));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get(null, "name", "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get("owner", null, "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get("owner", "name", null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.Get("", "name", "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.Get("owner", "", "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.Get("owner", "name", ""));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -60,11 +60,11 @@ public class CommitsClientTests
|
||||
var client = new CommitsClient(Substitute.For<IApiConnection>());
|
||||
|
||||
var newCommit = new NewCommit("message", "tree", new[]{"parent1", "parent2"});
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create(null, "name", newCommit));
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("owner", null, newCommit));
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("owner", "name", null));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.Create("", "name", newCommit));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.Create("owner", "", newCommit));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create(null, "name", newCommit));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create("owner", null, newCommit));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create("owner", "name", null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.Create("", "name", newCommit));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.Create("owner", "", newCommit));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user