Example #1
0
        public void PlatformClientFormatBadRequestOk()
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.BadRequest)
            {
                Content = new StringContent("content explanation"),
            };

            PlatformClientException exception = new PlatformClientException(response);

            Assert.Equal("400 - Bad Request - content explanation", exception.Message);
        }
Example #2
0
        public void PlatformClientFormat500Ok()
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.InternalServerError)
            {
                Content = new StringContent("my error text"),
            };

            PlatformClientException exception = new PlatformClientException(response);

            Assert.Equal("500 - Internal Server Error - my error text", exception.Message);
        }
Example #3
0
        public void PlatformClientExceptionWithMessageOk()
        {
            PlatformClientException exception = new PlatformClientException("Something is wrong");

            Assert.Equal("Something is wrong", exception.Message);
        }