public void Ext_CanAddPolicy() { SpyStrategy spy = new SpyStrategy(); SpyPolicy spyPolicy = new SpyPolicy(); SpyExtension extension = new SpyExtension(spy, UnityBuildStage.PostInitialization, spyPolicy, typeof(SpyPolicy)); IUnityContainer container = new UnityContainer() .AddExtension(extension); container.Resolve <object>(); Assert.IsTrue(spyPolicy.WasSpiedOn); }
public void ExtensionCanAddPolicy() { var spy = new SpyStrategy(); SpyPolicy spyPolicy = new SpyPolicy(); SpyExtension extension = new SpyExtension(spy, Stage.PreCreation, spyPolicy, typeof(SpyPolicy)); IUnityContainer container = new UnityContainer() .AddExtension(extension); container.Resolve <object>(); Assert.IsTrue(spyPolicy.WasSpiedOn); }
public void ExtensionCanAddPolicy() { SpyStrategy spy = new SpyStrategy(); SpyPolicy spyPolicy = new SpyPolicy(); SpyExtension extension = new SpyExtension(spy, UnityBuildStage.PostInitialization, spyPolicy, typeof(SpyPolicy)); IUnityContainer container = new UnityContainer() .AddExtension(extension); container.Resolve<object>(); Assert.True(spyPolicy.WasSpiedOn); }