public async void GetAllAsync_Called_CallsBuildUriWithFieldId() { // Given _client.Setup(b => b.BuildUri(It.IsAny <string>(), It.IsAny <string>())).Returns(new Uri("http://search")); var ticketResource = new TicketResource(_client.Object); // When await ticketResource.GetAllAsync(new List <long> { 321, 456, 789 }); // Then _client.Verify(c => c.BuildUri(It.Is <string>(s => s.Contains("/show_many")), It.IsAny <string>())); }
public async void GetAllAsync_Called_ReturnsTicketResponse() { // Given var response = new TicketListResponse { Results = new List <Ticket> { new Ticket { Id = 1 } } }; _client.Setup(b => b.GetAsync <TicketListResponse>(It.IsAny <Uri>())).Returns(TaskHelper.CreateTaskFromResult(response)); var ticketResource = new TicketResource(_client.Object); // When var result = await ticketResource.GetAllAsync(new List <long> { 321, 456, 789 }); // Then Assert.That(result, Is.EqualTo(response)); }