简体   繁体   中英

Disable NancyFx module discovery

Is there a way to disable the module discovery and explicitly specify what module classes to use?

This is for test performance reasons. The project states that:

"[scanning] it is part of the startup of any Nancy application and is only performed once and the information is then cached."

and that's dandy, but it seems every unit test also does this global scan, and then it's not fast enough.

That information is for application runtime, not testing. When you are testing a Nancy application, using our testing features such as the Browser class Nancy will require you to be explicit about this

You do this by using a combination of the Module(...) , Module<T>() or Modules(...) methods during the Browser / ConfigurableBootstrapper setup

The one time that the testing features would use all modules during testing is if you've explicitly called AllDiscoveredModules instead

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