public void GetAll_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
            ticketResource.GetAll(new List<long> { 321, 456, 789 });

            // Then
            _client.Verify(c => c.BuildUri(It.Is<string>(s => s.Contains("/show_many")), It.IsAny<string>()));
        }
        public void GetAll_Called_ReturnsTicketResponse()
        {
            // Given
            var response = new TicketListResponse { Results = new List<Ticket> { new Ticket { Id = 1 } } };
            _client.Setup(b => b.Get<TicketListResponse>(It.IsAny<Uri>())).Returns(response);
            var ticketResource = new TicketResource(_client.Object);

            // When
            var result = ticketResource.GetAll(new List<long> { 321, 456, 789 });

            // Then
            Assert.That(result, Is.EqualTo(response));
        }
        public void GetAll_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
            ticketResource.GetAll(new List <long> {
                321, 456, 789
            });

            // Then
            _client.Verify(c => c.BuildUri(It.Is <string>(s => s.Contains("/show_many")), It.IsAny <string>()));
        }
        public void GetAll_Called_ReturnsTicketResponse()
        {
            // Given
            var response = new TicketListResponse {
                Results = new List <Ticket> {
                    new Ticket {
                        Id = 1
                    }
                }
            };

            _client.Setup(b => b.Get <TicketListResponse>(It.IsAny <Uri>())).Returns(response);
            var ticketResource = new TicketResource(_client.Object);

            // When
            var result = ticketResource.GetAll(new List <long> {
                321, 456, 789
            });

            // Then
            Assert.That(result, Is.EqualTo(response));
        }