public void StrategyCreatesBuildPlanWhenItDoesntExist() { MockBuilderContext context = new MockBuilderContext(); context.Strategies.Add(new BuildPlanStrategy()); MockBuildPlanCreatorPolicy policy = new MockBuildPlanCreatorPolicy(); context.Policies.SetDefault<IBuildPlanCreatorPolicy>(policy); object result = context.ExecuteBuildUp(new NamedTypeBuildKey<object>(), null); Assert.NotNull(result); Assert.True(policy.PolicyWasCreated); IBuildPlanPolicy plan = context.Policies.Get<IBuildPlanPolicy>(new NamedTypeBuildKey(typeof(object))); Assert.NotNull(plan); }
public void StrategyCreatesBuildPlanWhenItDoesntExist() { MockBuilderContext context = new MockBuilderContext(); context.Strategies.Add(new BuildPlanStrategy()); MockBuildPlanCreatorPolicy policy = new MockBuildPlanCreatorPolicy(); context.Policies.SetDefault <IBuildPlanCreatorPolicy>(policy); object result = context.ExecuteBuildUp(new NamedTypeBuildKey <object>(), null); Assert.NotNull(result); Assert.True(policy.PolicyWasCreated); IBuildPlanPolicy plan = context.Policies.Get <IBuildPlanPolicy>(new NamedTypeBuildKey(typeof(object))); Assert.NotNull(plan); }