我有一個使用masterpage.asx.cs中的Request.UrlReferrer.Host的方法。如何爲單元測試中的httprequest usercontrol的請求分配一個值?
protected string DoSomething()
{
Request.UrlReferrer.Host is used
//Request is of httprequest usercontrol
}
我想爲這種方法編寫一個單元測試用例。
並且有一個調用target.DoSomething()但該請求具有空值。我怎樣才能給它一個值,以便DoSomething()方法不會中斷?
請幫忙。
謝謝。