public void try_a_simple_constructor_with_all_constants() { var step = ConcreteBuild <CtorTarget> .For(() => new CtorTarget("", 0)); step.Constructor.Add(Constant.For("Jeremy")); step.Constructor.Add(Constant.For <int>(39)); var context = new FakeBuildSession(); var target = step.Build <CtorTarget>(context); target.Name.ShouldEqual("Jeremy"); target.Age.ShouldEqual(39); }
public void try_a_simple_constructor_with_all_constants() { var step = ConcreteBuild <CtorTarget> .For(() => new CtorTarget("", 0)); step.Constructor.Add(Constant.For("Jeremy")); step.Constructor.Add(Constant.For <int>(39)); var context = new FakeContext(); var builder = (Func <IContext, CtorTarget>)step.ToDelegate(); var target = builder(context); target.Name.ShouldEqual("Jeremy"); target.Age.ShouldEqual(39); }