public void HttpResponseMessageAsFormattedStringHandlesEmptyRequests() { using (var httpRequest = new HttpResponseMessage()) { var formattedString = CloudTracingExtensions.AsFormattedString(httpRequest); Assert.Contains("StatusCode: 200", formattedString); } }
public void HttpRequestMessageAsFormattedStringHandlesEmptyRequests() { using (var httpRequest = new HttpRequestMessage()) { var formattedString = CloudTracingExtensions.AsFormattedString(httpRequest); Assert.Contains("Method: GET", formattedString); } }
public void HttpResponseMessageAsFormattedStringHandlesRequestsWithHeaders() { using (var httpRequest = new HttpResponseMessage(HttpStatusCode.OK)) { httpRequest.Headers.Add("x-ms-version", "2013-11-01"); var formattedString = CloudTracingExtensions.AsFormattedString(httpRequest); Assert.Contains("StatusCode: 200", formattedString); Assert.Contains("x-ms-version: 2013-11-01", formattedString); } }
public void DictionaryAsFormattedStringWorksWithNulls() { var parameters = new Dictionary <string, object>(); parameters["a"] = 1; parameters["b"] = "str"; parameters["c"] = null; var formattedString = CloudTracingExtensions.AsFormattedString(parameters); Assert.Equal("{a=1,b=str,c=}", formattedString); }
public void DictionaryAsFormattedStringReturnsSet() { var parameters = new Dictionary <string, object>(); parameters["a"] = 1; parameters["b"] = "str"; parameters["c"] = true; var formattedString = CloudTracingExtensions.AsFormattedString(parameters); Assert.Equal("{a=1,b=str,c=True}", formattedString); }
public void HttpResponseMessageAsFormattedStringHandlesRequestsWithContent() { using (var httpRequest = new HttpResponseMessage(HttpStatusCode.OK)) { httpRequest.Content = new StringContent("<body/>"); var formattedString = CloudTracingExtensions.AsFormattedString(httpRequest); Assert.Contains("StatusCode: 200", formattedString); Assert.Contains("<body/>", formattedString); } }
public void HttpRequestMessageAsFormattedStringHandlesRequestsWithContent() { using (var httpRequest = new HttpRequestMessage(HttpMethod.Get, "http://www.windowsazure.com/test")) { httpRequest.Content = new StringContent("<body/>"); var formattedString = CloudTracingExtensions.AsFormattedString(httpRequest); Assert.Contains("Method: GET", formattedString); Assert.Contains("RequestUri: 'http://www.windowsazure.com/test'", formattedString); Assert.Contains("<body/>", formattedString); } }
public void HttpRequestMessageAsFormattedStringHandlesRequestsWithHeaders() { using (var httpRequest = new HttpRequestMessage(HttpMethod.Get, "http://www.windowsazure.com/test")) { httpRequest.Headers.Add("x-ms-version", "2013-11-01"); var formattedString = CloudTracingExtensions.AsFormattedString(httpRequest); Assert.Contains("Method: GET", formattedString); Assert.Contains("RequestUri: 'http://www.windowsazure.com/test'", formattedString); Assert.Contains("x-ms-version: 2013-11-01", formattedString); } }
public void HttpResponseMessageAsFormattedStringThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => CloudTracingExtensions.AsFormattedString((HttpResponseMessage)null)); }
public void DictionaryAsFormattedStringReturnsEmptyBracesForEmptySet() { var formattedString = CloudTracingExtensions.AsFormattedString(new Dictionary <string, object>()); Assert.Equal("{}", formattedString); }
public void DictionaryAsFormattedStringReturnsEmptyBracesForNull() { var formattedString = CloudTracingExtensions.AsFormattedString((Dictionary <string, object>)null); Assert.Equal("{}", formattedString); }