I have following piece of code to evaluate the IP address
public string getIPAddress()
{
string IPAddress = string.Empty;
String strHostName = HttpContext.Current.Request.UserHostAddress.ToString();
IPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
return IPAddress;
}
Now when I tried to implement unit testing for this method, it always throws error, null reference,
I could not change the actual method just for unit testing, is there any way to handle this...
Thanks