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