Example #1
0
        public void DesrializeJsonFromStream_ReturnsNullWhenStreamIsNull()
        {
            HttpClient     httpClient     = new HttpClient();
            HttpClientBase httpClientBase = new HttpClientBase(httpClient, loggerMock.Object);

            var result = httpClientBase.DeserializeJsonFromStream <string>(null);

            result.Should().BeNull();
        }
Example #2
0
        public void DeserializeJsonFromStream_ReturnsValueWhenStreamHasValue()
        {
            HttpClient     httpClient     = new HttpClient();
            HttpClientBase httpClientBase = new HttpClientBase(httpClient, loggerMock.Object);

            using (MemoryStream ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes("true")))
            {
                var result = httpClientBase.DeserializeJsonFromStream <bool>(ms);
                result.Should().BeTrue();
            }
        }