Skip to content

Commit

Permalink
Add missing unit tests for ReferencesClient
Browse files Browse the repository at this point in the history
  • Loading branch information
gdziadkiewicz committed Nov 11, 2017
1 parent e744502 commit 05a2ecf
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Octokit.Tests/Clients/ReferencesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ public async Task EnsuresNonNullArguments()

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, "name"));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("owner", null));

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, "name", ApiOptions.None));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("owner", null, ApiOptions.None));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("owner", "name", null));

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(1, null));


await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", "name"));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("owner", ""));

await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", "name", ApiOptions.None));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("owner", "", ApiOptions.None));
}

[Fact]
Expand Down Expand Up @@ -110,16 +116,27 @@ public async Task EnsuresNonNullArguments()
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace(null, "name", "heads"));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace("owner", null, "heads"));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace("owner", "name", null));

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace(null, "name", "heads", ApiOptions.None));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace("owner", null, "heads", ApiOptions.None));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace("owner", "name", null, ApiOptions.None));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace("owner", "name", "heads", null));

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace(1, null));

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace(1, null, ApiOptions.None));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForSubNamespace(1, "subnamespace", null));

await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace("", "name", "heads"));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace("owner", "", "heads"));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace("owner", "name", ""));

await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace("", "name", "heads", ApiOptions.None));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace("owner", "", "heads", ApiOptions.None));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace("owner", "name", "", ApiOptions.None));

await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace(1, ""));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForSubNamespace(1, "", ApiOptions.None));
}

[Fact]
Expand Down

0 comments on commit 05a2ecf

Please sign in to comment.