public async Task EnsuresNonEmptyArguments() { var connection = Substitute.For <IApiConnection>(); var client = new CheckSuitesClient(connection); await Assert.ThrowsAsync <ArgumentException>(() => client.Rerequest("", "repo", 1)); await Assert.ThrowsAsync <ArgumentException>(() => client.Rerequest("fake", "", 1)); }
public async Task RequestsCorrectUrlWithRepositoryId() { var connection = MockedIApiConnection.PostReturnsHttpStatus(HttpStatusCode.Created); var client = new CheckSuitesClient(connection); await client.Rerequest(1, 1); connection.Connection.Received().Post( Arg.Is <Uri>(u => u.ToString() == "repositories/1/check-suites/1/rerequest"), Args.Object, "application/vnd.github.antiope-preview+json"); }