简体   繁体   中英

How to override Structuremap registry in integration tests for Asp.Net MVC

I am writting UI Integration tests/Acceptance tests for a MVC website. I want to be able to override the repository classes at run time for these tests with my InMemory repository classes.

I am using Structuremap default configuration and the thing that I want to achieve is to tell my acceptance tests to use InMemory Repositories instead of the default ones that are configured.

I am not sure how this can be done? Can you please guide me?

I am not interested in using In Memory DBs or No SQL DBs for this purpose so kindly advice me how can I change the class instance at run time.

The documentation gives some examples of how to do this.

http://docs.structuremap.net/ChangingConfigurationAtRuntime.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM