private void UpdateSpyPolicy(IBuilderContext context) { SpyPolicy policy = context.Policies.Get <SpyPolicy>(context.BuildKey); if (policy != null) { policy.WasSpiedOn = true; } }
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); }