Skip to content

Integration Testing Mode for easy runtime swapping of services #342

@jeremydmiller

Description

@jeremydmiller

// cc @kkorotky

Request from one of our teams. Lamar is not nearly as flexible as StructureMap at runtime. This was a conscious decision on my part to improve performance and keep folks from shooting themselves in the foot and running to me for help when they did. The downside is that is that Lamar isn't that great for swapping in test services per test. You can use Injectable upfront, but that requires knowing which services will be swapped out ahead of time.

What if we had a mode where the container allowed for easier swapping at will, and reset all registrations back to the original registration with a single method call in a test fixture clean up? More investigation necessary. I'm thinking that in this mode Lamar uses QuickBuild() for everything so it's easier to swap things in and out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions