public void CreatingInstanceCreatedBuildPlanUsingPlanBuilderPolicy()
        {
            MockBuilderContext ctx = BuildContext();
            MockObject expectedObject = new MockObject();

            IBuildPlan buildPlan = new MockBuildPlan(expectedObject);
            IPlanBuilderPolicy planBuilderPolicy = new MockPlanBuilderPolicy(buildPlan);
            ctx.Policies.SetDefault<IPlanBuilderPolicy>(planBuilderPolicy);

            MockObject i1 = (MockObject) ctx.HeadOfChain.BuildUp(ctx, typeof (MockObject), null, null);

            Assert.IsNotNull(i1);
            Assert.AreSame(expectedObject, i1);
        }
        public void CreatingInstanceGetsProperBuildPlanUsingBuildPlanPolicy()
        {
            MockBuilderContext ctx = BuildContext();
            MockObject expectedObject = new MockObject();

            IBuildPlan buildPlan = new MockBuildPlan(expectedObject);
            IBuildPlanPolicy buildPlanPolicy = new BuildPlanPolicy();
            buildPlanPolicy.Set(typeof (MockObject), buildPlan);
            ctx.Policies.SetDefault<IBuildPlanPolicy>(buildPlanPolicy);

            MockObject i1 = (MockObject) ctx.HeadOfChain.BuildUp(ctx, typeof (MockObject), null, null);

            Assert.IsNotNull(i1);
            Assert.AreSame(expectedObject, i1);
        }