public async Task MergePullRequest_ShouldCallCorrectUrlAndMethod() { var request = new Fixture().Create <MergeRequest>(); var result = _restClient .Capture() .Args <IRestRequest, IRestResponse>((s, req) => s.ExecuteTaskAsync(req), MockRepository.GenerateMock <IRestResponse>()); await _sut.MergePullRequest("repo", "owner", request); Assert.AreEqual(1, result.CallCount); var args = result.Args[0]; Assert.AreEqual($"repositories/owner/repo/pullrequests/{request.Id}/merge", args.Resource); Assert.AreEqual(Method.POST, args.Method); }