각 테스트 설정에서 컨테이너를 설치하는 통합 테스트를 작성하고 있습니다. 나는 등록 코드를 재사용하고있어,하지만 난이 오류가 Lifestyle.Scoped와 종속성을 등록하려고 오류가 발생합니다 :유닛 테스트 중에 어떤 간단한 인젝터 범위 라이프 스타일을 사용해야합니까?
내 경우에 사용한다 무엇 DefaultScopedLifestyleSetUp : 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.
? 범위는 실제로 싱글 톤이어야하지만 webapi 앱에서 등록 코드를 재사용한다는 것을 기억하십시오.