public void LogsNullRequest() { Log4NetTracingInterceptor logger = new Log4NetTracingInterceptor("app.config"); string invocationId = null; HttpRequestMessage request = null; string expected = "DEBUG - invocationId: \r\nrequest: \r\n"; logger.SendRequest(invocationId, request); Assert.Equal(expected, File.ReadAllText(logFileName)); }
public void LogsRequest() { Log4NetTracingInterceptor logger = new Log4NetTracingInterceptor("app.config"); string invocationId = "12345"; HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://azuresdk.com"); string expected = string.Format("DEBUG - invocationId: {0}\r\nrequest: {1}\r\n", invocationId, request.AsFormattedString()); logger.SendRequest(invocationId, request); string actual = File.ReadAllText(logFileName); Assert.Equal(expected, actual); }