我正在編寫集成測試,在每個測試設置上設置一個容器。我重用註冊碼,但我得到試圖註冊與Lifestyle.Scoped依賴我得到這個錯誤時的錯誤:哪種簡單的注射器適用範圍的生活方式應該在單元測試中使用?
SetUp : System.InvalidOperationException : To be able to use the Lifestyle.Scoped property, please ensure that the container is configured with a default scoped lifestyle by setting the Container.Options.DefaultScopedLifestyle property with the required scoped lifestyle for your type of application.
我應該在我的情況下使用什麼DefaultScopedLifestyle?範圍應該是單身人士,但請記住,我正在重複使用來自webapi應用程序的註冊碼。