コード例 #1
0
        public void CanResolveCommand()
        {
            using (var currentContainer = ApplicationContainerFactory.Create(RegisterComponents))
            {
                currentContainer.RegisterMany <ICommand, FakeCommmand>();
                currentContainer.RegisterMany <ICommand, CopyCommmand>();

                var service = currentContainer.Resolve <CommandManagementService>();

                var command = service.GetCommand("fake") as FakeCommmand;
                Assert.IsNotNull(command);

                command.Execute(Enumerable.Empty <string>());
                Assert.IsTrue(command.Executed);
            }
        }
コード例 #2
0
        public void SimpleModel2Code()
        {
            // MISSING
            // - process the output decl of the pipeline

            using (var container = ApplicationContainerFactory.Create(Application.RegisterComponents))
            {
                var parameters = new Dictionary <string, string>
                {
                    { "project-root", Environment.CurrentDirectory }
                };

                var solution = Solution.ParseFile("Projects\\DDD.config.json");
                solution.AddParameters(parameters);

                var engine = container.Activate <PipelineEngine>();
                engine.Process(new SolutionEventContext(solution));

                Assert.IsTrue(File.Exists(Path.Combine(Environment.CurrentDirectory, "Generated\\DomainObjects.cs")));
            }
        }