public void TestAddRequestTrace_WhenSuccess() { var jsonBytes = Encoding.ASCII.GetBytes(Constants.NegotiateJsonResponse); sqlOperationMock.Setup(s => s.Execute(It.IsAny <ExecuteSqlQuery>(), It.IsAny <object[]>())).Returns(1); sqlOperationMock.Setup(s => s.ExecuteAsync(It.IsAny <ExecuteSqlQuery>(), It.IsAny <object[]>())); sqlOperationMock.Setup(s => s.Select <SessionDto>(It.IsAny <SelectSqlQuery>(), It.IsAny <object[]>())).Returns(new SessionDto()); owinRequestMock.Setup(s => s.Path).Returns(new PathString("/negotiate")); owinRequestMock.Setup(s => s.Uri).Returns(new Uri("http://fake.com")); owinRequestMock.SetReturnsDefault(""); owinRequestMock.Setup(s => s.Body).Returns(new MemoryStream()); var signalrRequest = new SignalrRequest(owinContextMock.Object); var result = dataTracingService.AddRequestTrace(signalrRequest); Assert.IsTrue(result); }
protected override void OnPreRequest() { LogHelper.Log("OnPreRequest"); _tracer.AddRequestTrace(CurrentRequest); }