public void CreateHttpPropertiesCopiesAllProperties() { KissLog.Http.HttpProperties httpProperties = CommonTestHelpers.Factory.CreateHttpProperties(); var result = PayloadFactory.Create(httpProperties); TestUrl(httpProperties.Request.Url, result.Url); Assert.AreEqual(httpProperties.Request.UserAgent, result.UserAgent); Assert.AreEqual(httpProperties.Request.HttpMethod, result.HttpMethod); Assert.AreEqual(httpProperties.Request.HttpReferer, result.HttpReferer); Assert.AreEqual(httpProperties.Request.RemoteAddress, result.RemoteAddress); TestRequestProperties(httpProperties.Request.Properties, result.Request); TestResponseProperties(httpProperties.Response, result.Response); }
internal static HttpProperties Create(KissLog.Http.HttpProperties httpProperties) { if (httpProperties == null) { throw new ArgumentNullException(nameof(httpProperties)); } Url url = Create(httpProperties.Request.Url); RequestProperties requestProperties = Create(httpProperties.Request.Properties); ResponseProperties responseProperties = Create(httpProperties.Response); return(new HttpProperties { Url = url, UserAgent = httpProperties.Request.UserAgent, HttpMethod = httpProperties.Request.HttpMethod, HttpReferer = httpProperties.Request.HttpReferer, RemoteAddress = httpProperties.Request.RemoteAddress, Request = requestProperties, Response = responseProperties }); }
public void CreateHttpPropertiesThrowsExceptionForNullArgument() { KissLog.Http.HttpProperties httpProperties = null; var result = PayloadFactory.Create(httpProperties); }