示例#1
0
 public void CanAddContainerExtensionViaConfig()
 {
     TestForExpectedActions("ContainerExtensions", Sequence.Collect(
                                ConfigurationActionRecord.AddExtensionAction(typeof(MockContainerExtension)),
                                ConfigurationActionRecord.RegisterAction(typeof(ILogger), typeof(SpecialLogger), null, new ContainerControlledLifetimeManager())
                                ));
 }
示例#2
0
 public void CanSpecifyLifetimeForType()
 {
     TestForExpectedActions("Lifetimes",
                            Sequence.Collect(
                                ConfigurationActionRecord.RegisterAction(
                                    typeof(ILogger), typeof(SpecialLogger), null,
                                    new ContainerControlledLifetimeManager()),
                                ConfigurationActionRecord.RegisterAction(
                                    typeof(ILogger), typeof(MockLogger), "mock",
                                    new ExternallyControlledLifetimeManager()),
                                ConfigurationActionRecord.RegisterAction(
                                    typeof(ILogger), typeof(MockLogger), "session",
                                    new SessionLifetimeManager("sessionKey")),
                                ConfigurationActionRecord.RegisterAction(
                                    typeof(ILogger), typeof(MockLogger), "reverseSession",
                                    new SessionLifetimeManager("sdrawkcab")),
                                ConfigurationActionRecord.RegisterAction(
                                    typeof(ILogger), typeof(MockLogger), "transient", null),
                                ConfigurationActionRecord.RegisterAction(
                                    typeof(ILogger), typeof(MockLogger), "explicitTransient", null)
                                )
                            );
 }
示例#3
0
 public void ContainerGeneratesExpectedConfiguration()
 {
     TestForExpectedActions("UnnamedContainers", Sequence.Collect(
                                ConfigurationActionRecord.RegisterAction(typeof(ILogger), typeof(SpecialLogger), null, new ContainerControlledLifetimeManager())
                                ));
 }