0
我在填充沒有ref關鍵字的數組參數時遇到問題。Rhino Mocks:在沒有「ref」關鍵字的存根中填充數組參數
對於該簽名:
int ReceiveData(ref byte[] data)
工作的:
byte[] dataParameter = new byte[8];
byte[] testData = new byte[] { 1, 2, 3, 4 };
this.mockObject.Stub(t => t.ReceiveData(ref dataParameter)).OutRef(testData).Return(4);
調用 「receiveData的」 後,將 「數據」 參數具有值{1,2,3,4}。 我應該怎麼做,以填補該簽名的數據參數:
int ReceiveData(byte[] data)
OUTREF()這是行不通的。任何想法? 謝謝...