Exemple #1
0
        public void WhenCanHostingRequestShouldSameRequest()
        {
            var listener = new DiagnosticListener(D.DiagnosticListenerName);
            var sut      = new TestDiagnostic();

            listener.SubscribeWithAdapter(sut);
            var result = new Request();

            listener.HostingRequest(result);
            Assert.Same(result, sut.Request);
        }
Exemple #2
0
        public void WhenCanClientResponseShouldSameRequest()
        {
            var listener = new DiagnosticListener(D.DiagnosticListenerName);
            var sut      = new TestDiagnostic();

            listener.SubscribeWithAdapter(sut);
            var result   = new Request();
            var response = new Response();

            listener.ClientResponse(result, response);
            Assert.Same(result, sut.Request);
            Assert.Same(response, sut.Response);
        }
Exemple #3
0
        public void WhenCanHostingExceptionShouldSameRequest()
        {
            var listener = new DiagnosticListener(D.DiagnosticListenerName);
            var sut      = new TestDiagnostic();

            listener.SubscribeWithAdapter(sut);
            var result   = new Request();
            var response = new Response();
            var ex       = new Exception();

            listener.HostingException(result, response, ex);
            Assert.Same(result, sut.Request);
            Assert.Same(response, sut.Response);
            Assert.Same(ex, sut.Exception);
        }