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

            // When
            userResource.Get(4321);

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

            // When
            userResource.Get(4321);

            // Then
            _client.Verify(c => c.BuildUri(It.Is<string>(s => s.Contains("4321")), ""));
        }
        public void Get_Called_ReturnsUserResponse()
        {
            // Given
            var response = new UserResponse { Item = new User { Id = 1 } };
            _client.Setup(b => b.Get<UserResponse>(It.IsAny<Uri>())).Returns(response);
            var userResource = new UserResource(_client.Object);

            // When
            var result = userResource.Get(4321);

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

            _client.Setup(b => b.Get <UserResponse>(It.IsAny <Uri>())).Returns(response);
            var userResource = new UserResource(_client.Object);

            // When
            var result = userResource.Get(4321);

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