public void sendDataShouldNotAddASlashIfAlreadyPresent() { var url = "http://localhost/"; var sender = new HttpZipkinSender(httpClient, url, contentType); sender.Send(content); mockMessageHandler.Verify(h => h.Send(It.Is <HttpRequestMessage>( m => m.RequestUri.Equals(url + "api/v1/spans") ))); }
public void sendDataShouldSendOnSpansEndPoint() { var contentType = "application/x-thrift"; var sender = new HttpZipkinSender(httpClient, url, contentType); sender.Send(content); mockMessageHandler.Verify(h => h.Send(It.Is <HttpRequestMessage>( m => m.RequestUri.Equals(url + "/api/v1/spans") && m.Content.Headers.GetValues("Content-Type").Contains(contentType) && m.Content.Headers.GetValues("Content-Length").Contains(content.Length.ToString()) && m.Method == HttpMethod.Post ))); }
public void invalidUrlShouldThrowWhenSending() { var sender = new HttpZipkinSender(httpClient, "url", contentType); Assert.Throws <InvalidOperationException>(() => sender.Send(content)); }