mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 03:01:31 +00:00
Fixing some unit tests that were not doing
any assertions. Adding Received() where it was missing. The majority of these instances were unawaited AssertEx.Throws They are now all either awaited or replaced with Assert.Throw Assert.Throw was used when possible and when not an option AssertEx.Throw was awaited.
This commit is contained in:
@@ -295,21 +295,16 @@ using Xunit;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresArgumentsNotNull()
|
||||
public void EnsuresArgumentsNotNull()
|
||||
{
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableIssuesClient(gitHubClient);
|
||||
|
||||
AssertEx.Throws<ArgumentNullException>(async () => await
|
||||
client.Create(null, "name", new NewIssue("title")));
|
||||
AssertEx.Throws<ArgumentException>(async () => await
|
||||
client.Create("", "name", new NewIssue("x")));
|
||||
AssertEx.Throws<ArgumentNullException>(async () => await
|
||||
client.Create("owner", null, new NewIssue("x")));
|
||||
AssertEx.Throws<ArgumentException>(async () => await
|
||||
client.Create("owner", "", new NewIssue("x")));
|
||||
AssertEx.Throws<ArgumentNullException>(async () => await
|
||||
client.Create("owner", "name", null));
|
||||
Assert.Throws<ArgumentNullException>(() => client.Create(null, "name", new NewIssue("title")));
|
||||
Assert.Throws<ArgumentException>(() => client.Create("", "name", new NewIssue("x")));
|
||||
Assert.Throws<ArgumentNullException>(() => client.Create("owner", null, new NewIssue("x")));
|
||||
Assert.Throws<ArgumentException>(() => client.Create("owner", "", new NewIssue("x")));
|
||||
Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,21 +323,16 @@ using Xunit;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresArgumentsNotNull()
|
||||
public void EnsuresArgumentsNotNull()
|
||||
{
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableIssuesClient(gitHubClient);
|
||||
|
||||
AssertEx.Throws<ArgumentNullException>(async () => await
|
||||
client.Create(null, "name", new NewIssue("title")));
|
||||
AssertEx.Throws<ArgumentException>(async () => await
|
||||
client.Create("", "name", new NewIssue("x")));
|
||||
AssertEx.Throws<ArgumentNullException>(async () => await
|
||||
client.Create("owner", null, new NewIssue("x")));
|
||||
AssertEx.Throws<ArgumentException>(async () => await
|
||||
client.Create("owner", "", new NewIssue("x")));
|
||||
AssertEx.Throws<ArgumentNullException>(async () => await
|
||||
client.Create("owner", "name", null));
|
||||
Assert.Throws<ArgumentNullException>(() => client.Create(null, "name", new NewIssue("title")));
|
||||
Assert.Throws<ArgumentException>(() => client.Create("", "name", new NewIssue("x")));
|
||||
Assert.Throws<ArgumentNullException>(() => client.Create("owner", null, new NewIssue("x")));
|
||||
Assert.Throws<ArgumentException>(() => client.Create("owner", "", new NewIssue("x")));
|
||||
Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", null));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user