static void StoreRequestInfoForAssertion(HttpListenerContext context, ListenerAssertion assertData) { assertData.Url = context.Request.Url.AbsoluteUri; assertData.RequestBody = context.Request.Body(); if (context.User != null) { var identity = context.User.Identity as HttpListenerBasicIdentity; if (identity != null) { assertData.Username = identity.Name; assertData.Password = identity.Password; } } }
static void StoreRequestInfoForAssertion(HttpListenerRequest request, ListenerAssertion assertData) { assertData.Url = request.Url.AbsoluteUri; assertData.RequestBody = request.Body(); }