public void LogsNullResponse() { Log4NetTracingInterceptor logger = new Log4NetTracingInterceptor("app.config"); string invocationId = null; HttpResponseMessage response = null; string expected = "DEBUG - invocationId: \r\nresponse: \r\n"; logger.ReceiveResponse(invocationId, response); Assert.Equal(expected, File.ReadAllText(logFileName)); }
public void LogsResponse() { Log4NetTracingInterceptor logger = new Log4NetTracingInterceptor("app.config"); string invocationId = "12345"; HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Accepted); string expected = string.Format("DEBUG - invocationId: {0}\r\nresponse: {1}\r\n", invocationId, response.AsFormattedString()); logger.ReceiveResponse(invocationId, response); string actual = File.ReadAllText(logFileName); Assert.Equal(expected, actual); }