public void Get_Called_CallsBuildUriWithFieldId()
        {
            // Given
            _client.Setup(b => b.BuildUri(It.IsAny <string>(), It.Is <string>(s => s.Contains("321")))).Returns(new Uri("http://search"));
            var ticketResource = new TicketResource(_client.Object);

            // When
            ticketResource.Get(321);

            // Then
            _client.Verify(c => c.BuildUri(It.Is <string>(s => s.Contains("321")), ""));
        }
        public void Get_Called_CallsBuildUriWithFieldId()
        {
            // Given
            _client.Setup(b => b.BuildUri(It.IsAny<string>(), It.Is<string>(s => s.Contains("321")))).Returns(new Uri("http://search"));
            var ticketResource = new TicketResource(_client.Object);

            // When
            ticketResource.Get(321);

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

            // When
            var result = ticketResource.Get(321);

            // Then
            Assert.That(result, Is.EqualTo(response));
        }
        public void Get_Called_ReturnsTicketResponse()
        {
            // Given
            var response = new TicketResponse {
                Item = new Ticket {
                    Id = 1
                }
            };

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

            // When
            var result = ticketResource.Get(321);

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