Created
January 23, 2013 16:03
-
-
Save ewilde/4608673 to your computer and use it in GitHub Desktop.
How to test #structuremap configuration using #mspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Subject(typeof (CommonRegistry))] | |
public class When_add_common_registry_to_a_container | |
{ | |
Because of = () => ObjectFactory.Configure(x=>x.Scan(scanner=> | |
{ | |
scanner.AssemblyContainingType<ISerializer>(); | |
scanner.LookForRegistries(); | |
})); | |
It should_register_a_default_i_serializer = () => ObjectFactory.GetAllInstances<ISerializer>().Count.ShouldBeGreaterThan(0); | |
It should_regisiter_serializer_as_singleton = | |
() => | |
ObjectFactory.Model.PluginTypes.First(item => item.PluginType.UnderlyingSystemType == typeof (ISerializer)) | |
.Lifecycle.ShouldEqual(StructureMapConstants.Singleton); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment