public async void GetAllAsync_Called_CallsBuildUriWithFieldId() { // Given _client.Setup(b => b.BuildUri(It.IsAny <string>(), It.IsAny <string>())).Returns(new Uri("http://search")); var userResource = new UserResource(_client.Object); // When await userResource.GetAllAsync(new List <long> { 4321, 3456, 6789 }); // Then _client.Verify(c => c.BuildUri(It.Is <string>(s => s.Contains("/show_many")), It.Is <string>(st => st.Contains("4321,3456,6789")))); }
public async void GetAllAsync_Called_ReturnsUserResponse() { // Given var response = new UserListResponse { Results = new List <User> { new User { Id = 1 } } }; _client.Setup(b => b.GetAsync <UserListResponse>(It.IsAny <Uri>())).Returns(TaskHelper.CreateTaskFromResult(response)); var userResource = new UserResource(_client.Object); // When var result = await userResource.GetAllAsync(new List <long> { 4321, 3456, 6789 }); // Then Assert.That(result, Is.EqualTo(response)); }