1
我有一個在SubmitClick方法所使用的system.resx資源文件.resx資源文件如何進行單元測試?
Protected Sub SubmitClick(ByVal sender As Object, ByVal e As EventArgs)
(...)
If (... AndAlso ...) Then
SetError(Resources.system.groupNoAdminTran)
End If
End Sub
我的問題是,無論我如何努力進行單元測試這一點,當SETERROR被打了會導致測試失敗:
"Could not load file or assembly 'App_GlobalResources' or one of its
dependencies. The system cannot find the file specified."
有沒有什麼辦法可以模擬Resources.system?
感謝
什麼時候休息?你有錯誤嗎?你的單元測試沒有通過?你的單元測試看起來如何? –
當SetError命中時,單元測試將失敗,並顯示「無法加載文件或程序集」App_GlobalResources「或其某個依賴項,系統找不到指定的文件。 – kooshka
您的問題似乎是重複的: http://stackoverflow.com/questions/4153748/app-globalresources-not-loading-in-a-unit-test-case – Gilles