I make some fake class, that should have same behavior as original one.
Original class sometimes throws WebExceptions (with StatusCode
in response from server).
I want repeat this behavior without any connection.
So, how can i create new WebException(..., ..., ..., ...)
with needed StatusCode
You need to customize a class to increase the HTTP Status Code:
public class HttpWebException : WebException
{
public int HttpStatusCode { get; set; }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With