How do I test the scope of a registered type with structureMap?
For instance I have a registry:
public class DataRegistry : Registry
{
public DataRegistry()
{
ForRequestedType<ISessionManager>().TheDefaultIsConcreteType<SessionManager>().CacheBy(StructureMap.Attributes.InstanceScope.Singleton);
ForRequestedType<ISessionRequest>().TheDefaultIsConcreteType<SessionRequest>().CacheBy(StructureMap.Attributes.InstanceScope.HttpContext);
}
}
And I want to test that ISessionRequest instance scope is HttpContext. So I have a test:
[Test]
public void Container_AlwaysHas_OneSessionRequestPerHTTPContext()
{
//Setup
//Act
ObjectFactory.Configure(r => r.AddRegistry<DataRegistry>());
//Test
}
But I don't know to test the scope of the type once it's registered?