public void LifecycleDependencySource_accepts_Visitor()
        {
            var source = new LifecycleDependencySource(typeof(IGateway), new SmartInstance <StubbedGateway>());

            source.AcceptVisitor(theVisitor);

            theVisitor.AssertWasCalled(x => x.Lifecycled(source));
        }
Beispiel #2
0
        public void can_use_lifecyle_resolver_for_dependency()
        {
            var build    = new ConcreteBuild <LifecycleTarget>();
            var gateway  = new StubbedGateway();
            var instance = new ObjectInstance(gateway);

            var session = new FakeBuildSession();

            session.LifecycledObjects[typeof(IGateway)][instance]
                = gateway;

            var arg = new LifecycleDependencySource(typeof(IGateway), instance);

            build.ConstructorArgs(arg);

            var target = build.Build <LifecycleTarget>(session);

            target.Gateway.ShouldBeTheSameAs(gateway);
        }
Beispiel #3
0
 public void Lifecycled(LifecycleDependencySource source)
 {
     _writer.Line(source.Description);
     _buildPlanVisitor.Instance(null, source.Instance);
 }