public async Task EnsuresNonEmptyArguments() { var connection = Substitute.For <IApiConnection>(); var client = new CheckSuitesClient(connection); var newCheckSuite = new NewCheckSuite("123abc"); await Assert.ThrowsAsync <ArgumentException>(() => client.Create("", "repo", newCheckSuite)); await Assert.ThrowsAsync <ArgumentException>(() => client.Create("fake", "", newCheckSuite)); }
public async Task RequestsCorrectUrlWithRepositoryId() { var connection = Substitute.For <IApiConnection>(); var client = new CheckSuitesClient(connection); var newCheckSuite = new NewCheckSuite("123abc"); await client.Create(1, newCheckSuite); connection.Received().Post <CheckSuite>( Arg.Is <Uri>(u => u.ToString() == "repositories/1/check-suites"), newCheckSuite, "application/vnd.github.antiope-preview+json"); }