mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 12:26:18 +00:00
Fixed wording & split out unit tests
- One unit test for NonNullArguments - Another unit test for NonEMptyArguments
This commit is contained in:
@@ -794,18 +794,24 @@ namespace Octokit.Tests.Clients
|
||||
public class TheSha1Method
|
||||
{
|
||||
[Fact]
|
||||
public async Task EnsureNonNullArguments()
|
||||
public async void EnsuresNonNullArguments()
|
||||
{
|
||||
var client = new RepositoryCommitsClient(Substitute.For<IApiConnection>());
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetSha1("", "name", "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetSha1("owner", "", "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetSha1("owner", "name", ""));
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresNonEmptyArguments()
|
||||
{
|
||||
var client = new RepositoryCommitsClient(Substitute.For<IApiConnection>());
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetSha1(null, "name", "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetSha1("", "name", "reference"));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetSha1("owner", null, "reference"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetSha1("owner", "", "reference"));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetSha1("owner", "name", null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetSha1("owner", "name", ""));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user