2011-10-11 42 views
-1
NSubstitute.Exceptions.CallNotReceivedException: Expected to receive call: 
    PromptForYesNo("Sums insured business interruption period is 653 month(s) longer than fire indemnity period.", any String) 
Actually received (non-matching arguments indicated with '*' characters): 
    PromptForYesNo(*"Sums insured business interruption period is 653 month(s) longer than fire indemnity period. 
"*, "Do you want to save?") 

任何人都可以看到什么问题是? 对我来说,这些字符串看起来完全相同,它们来自同一个对象属性。NSubstitute收到字符串不匹配

我会很感激为什么这会失败,谢谢。

+2

假设你已经准确地复制并粘贴了,第二个以第一个没有的换行符结束 - 可能是这样吗?如果没关系,你想忽略它,那么你可以在比较它们之前尝试使用.Trim()函数。 – Rup

+0

你是对的,实际上在那里有一个换行符。谢谢! – Johan

回答

0

有一个换行符,我没有注意到。