public void PatchAsync_Sad_Test()
        {
            //Arrange
            var testObject = new SimpleTestObject {
                TestProperty = "Test Value", TestProperty2 = 2
            };
            var httpClientResponse = new HttpResponseMessage(HttpStatusCode.InternalServerError)
            {
                Content = null
            };
            var httpClient = new Mock <IHttpClient>();

            httpClient.Setup(x => x.SendAsync(It.IsAny <HttpRequestMessage>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(httpClientResponse);
            var config     = new TestRestConfig();
            var restClient = new TestRestClient(config, httpClient.Object);

            //Act
            var responseTask = restClient.PatchAsync <SimpleTestObject, SimpleTestObject>("TestObject", testObject);
            var response     = responseTask.GetAwaiter().GetResult();

            //Assert
            Assert.IsFalse(response.IsSuccessStatusCode);
            Assert.IsNull(response.Data);
            Assert.AreEqual(response.StatusCode, HttpStatusCode.InternalServerError);
        }
        public void PatchAsync_Happy_Test()
        {
            //Arrange
            var testObject = new SimpleTestObject {
                TestProperty = "Test Value", TestProperty2 = 2
            };
            var content            = new StringContent(testObject.ToJsonString());
            var httpClientResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = content
            };
            var httpClient = new Mock <IHttpClient>();

            httpClient.Setup(x => x.SendAsync(It.IsAny <HttpRequestMessage>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(httpClientResponse);
            var config     = new TestRestConfig();
            var restClient = new TestRestClient(config, httpClient.Object);

            //Act
            var responseTask = restClient.PatchAsync <SimpleTestObject, SimpleTestObject>("TestObject", testObject);
            var response     = responseTask.GetAwaiter().GetResult();

            //Assert
            Assert.IsTrue(response.IsSuccessStatusCode);
            Assert.AreEqual(response.Data.TestProperty, testObject.TestProperty);
        }