Ejemplo n.º 1
0
        public void It_passes_step_id()
        {
            var containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterType <ParameterlessStep>();
            var factory = new AutofacStepFactory(containerBuilder.Build());
            var stepId  = new UniqueStepId("1", "1", "1", "1", "1");

            var instance = factory.CreateInstance(typeof(ParameterlessStep), stepId);

            Assert.AreSame(instance.StepId, stepId);
        }
Ejemplo n.º 2
0
        public void It_passes_dependencies_via_constructor()
        {
            var containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterType <DependencyImplementation>().AsImplementedInterfaces();
            containerBuilder.RegisterType <ParameterlessStepWithDependency>();
            var factory = new AutofacStepFactory(containerBuilder.Build());
            var stepId  = new UniqueStepId("1", "1", "1", "1", "1");

            var instance = (ParameterlessStepWithDependency)factory.CreateInstance(typeof(ParameterlessStepWithDependency), stepId);

            Assert.IsNotNull(instance.Dependency);
        }