2013-02-22 96 views
0

我使用墊片如下值:使用墊片:並非所有的代碼路徑返回

ShimTwilioRestClient.AllInstances.SendSmsMessageStringStringString = 
(@this, num, to, msg) => 
{ 
    Assert.IsNotNull(msg); 
}; 

但第一行給了我這個錯誤:

Not all code paths return a value in lambda expression of type Fakes.FakesDelegates.Func<TwilioReselientClient, String, String, String, SMSMessage>

+1

問題是我做錯了什麼?爲什麼我有這個錯誤 – 2013-02-22 12:51:17

回答

3

想必SendSmsMessageStringStringString財產是指成爲代表,返回SmsMessage ...但你沒有返回任何東西。

可能只能夠與閃避:

ShimTwilioRestClient.AllInstances.SendSmsMessageStringStringString = 
(@this, num, to, msg) => 
{ 
    Assert.IsNotNull(msg); 
    return null; 
}; 

...要看是什麼事情發生到返回值。

相關問題