0
方法:使用PrivateObject.Invoke調用靜態轉換功能是不是在單元測試工作
private static HipKvp[] GetRequestParameterArray(CaptchaRequestModel request){}
單元測試:
HipKvp[] input = (HipKvp[])privObj.Invoke("GetRequestParameterArray", new CaptchaRequestModel[] { result });
例外:
MissingMethodException was unhandled by user code:
Attempted to access a missing member.
我試過不同的方式,但不工作。
認識[工作](http://stackoverflow.com/questions/8609595/using-privateobject-invoke-to -call-A-靜態轉換功能,拒收編譯-I)。檢查拼寫和對象類型。 – 2013-03-13 04:06:27
http://stackoverflow.com/questions/5396996/how-can-i-use-privateobject-to-access-private-members-of-both-my-class-and-its-p 檢查此鏈接 - 並嘗試傳遞綁定標誌; – 2013-08-04 20:48:36