Пример #1
0
        public virtual IRemoteStoryHandler GetHandler(IEnumerable<Story> stories, IEventBus bus)
        {
            var spec = new AssemblyGenerationSpec { Assemblies = _assemblyRegistry.GetAssemblyLocations() };
            foreach (var story in stories)
            {
                spec.AddStory(story, story.Scenarios);
            }

            var assemblyLocation = _assemblyGenerator.GenerateAssembly(spec);
            return new RemoteStoryHandler(assemblyLocation, _filesystem, bus, _assemblyRegistry.GetAssemblyLocations());
        }
        public virtual IRemoteStoryHandler GetHandler(IEnumerable<Story> stories, IEventBus bus)
        {
            var spec = new AssemblyGenerationSpec { Assemblies = _assemblyRegistry.GetAssemblyLocations() };
            foreach (var story in stories)
            {
                spec.AddStory(story, story.Scenarios);
            }

            var assemblyLocation = _assemblyGenerator.GenerateAssembly(spec);
            var assembly = Assembly.LoadFrom(assemblyLocation);
            return new LocalHandler(Activator.CreateInstance(assembly.GetType("StorEvilTestAssembly.StorEvilDriver"), new object[] {bus}) as IStoryHandler);
            // return new RemoteStoryHandler(assemblyLocation, _filesystem, bus, _assemblyRegistry.GetAssemblyLocations());
        }
        public void SetupContext()
        {
            Generator = new AssemblyGenerator();
            _scenarios = new IScenario[]
                             {
                                 TestHelper.BuildScenario("foo", "When I do seomthing",
                                                          "something else should happen")
                             };

            var spec = new AssemblyGenerationSpec {Assemblies = new[] {this.GetType().Assembly.Location}};
            spec.AddStory(new Story("foo", "bar", _scenarios), _scenarios);

            GeneratedAssemblyPath = Generator.GenerateAssembly(spec);
        }