public async Task EnsuresNonNullArguments() { var client = new MilestonesClient(Substitute.For<IApiConnection>()); await AssertEx.Throws<ArgumentNullException>(async () => await client.Get(null, "name", 1)); await AssertEx.Throws<ArgumentNullException>(async () => await client.Get("owner", null, 1)); await AssertEx.Throws<ArgumentException>(async () => await client.Get(null, "", 1)); await AssertEx.Throws<ArgumentException>(async () => await client.Get("", null, 1)); }
public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new MilestonesClient(connection); client.Get("fake", "repo", 42); connection.Received().Get<Milestone>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/milestones/42"), null); }