public async Task GetRepositoryUsers_ShouldCallCorrectUrlAndGetResult() { var responseJson = Utilities.LoadFile(Paths.GetStandardDataPath("GetRepositoryUsersResponse.json")); var responseData = new NewtonsoftJsonSerializer().Deserialize <List <User> >(responseJson); var response = MockRepository.GenerateMock <IRestResponse <List <User> > >(); response.Stub(x => x.Data).Return(responseData); var result = _webClient .Capture() .Args <IRestRequest, IRestResponse <List <User> > >( (s, req) => s.ExecuteTaskAsync <List <User> >(req), response); var resultData = (await _sut.GetRepositoryUsers("reponame", "owner", "filter")).ToList(); Assert.AreEqual(1, result.CallCount); var args = result.Args[0]; Assert.Multiple(() => { Assert.AreEqual("mentions/repositories/owner/reponame", args.Resource); Assert.AreEqual(Method.GET, args.Method); var firstUser = resultData.First(); Assert.AreEqual("Zibi", firstUser.DisplayName); Assert.AreEqual(null, firstUser.Email); Assert.AreEqual("mistyku", firstUser.UserName); }); }