-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收到字符串不匹配
我會很感激爲什麼這會失敗,謝謝。
假設你已經準確地複製並粘貼了,第二個以第一個沒有的換行符結束 - 可能是這樣嗎?如果沒關係,你想忽略它,那麼你可以在比較它們之前嘗試使用.Trim()函數。 – Rup
你是對的,實際上在那裏有一個換行符。謝謝! – Johan