Exemplo n.º 1
0
        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")
                                                      )));
        }
Exemplo n.º 2
0
        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
                                                      )));
        }
Exemplo n.º 3
0
        public void invalidUrlShouldThrowWhenSending()
        {
            var sender = new HttpZipkinSender(httpClient, "url", contentType);

            Assert.Throws <InvalidOperationException>(() => sender.Send(content));
        }