Esempio n. 1
0
        public void BuildDetailsForComponent(IComponent component, ISolutionBuilderViewModel solutionBuilderModel)
        {
            var application = component.As <IProductElement>().Root.As <IApplication>();
            var components  = new List <IComponent> {
                component
            };
            var endpoints = application.Design.Endpoints.GetAll()
                            .Where(ep => ep.EndpointComponents.AbstractComponentLinks.Any(cl => cl.ComponentReference.Value == component));

            this.CleanDetails();

            // Endpoints
            this.CreateEndpointsPanel(application, solutionBuilderModel, endpoints, 0);

            // Commands
            this.CreateCommandsPanel(solutionBuilderModel, components, 1
                                     , component.Publishes.As <IProductElement>());

            // Events
            this.CreateEventsPanel(solutionBuilderModel, components, 2
                                   , component.Publishes.As <IProductElement>(), component.Subscribes.As <IProductElement>());

            // UseCases
            //this.CreateUseCasesPanel(solutionBuilderModel, component.As<IProductElement>(), application, 3);

            // Libraries
            this.CreateLibrariesPanel(solutionBuilderModel, component.As <IProductElement>(), application, 4);
        }
        public void BuildDetailsForComponent(IComponent component, ISolutionBuilderViewModel solutionBuilderModel)
        {
            var application = component.As<IProductElement>().Root.As<IApplication>();
            var components = new List<IComponent> { component };
            var endpoints = application.Design.Endpoints.GetAll()
                .Where(ep => ep.EndpointComponents.AbstractComponentLinks.Any(cl => cl.ComponentReference.Value == component));

            this.CleanDetails();

            // Endpoints
            this.CreateEndpointsPanel(application, solutionBuilderModel, endpoints, 0);

            // Commands
            this.CreateCommandsPanel(solutionBuilderModel, components, 1
                , component.Publishes.As<IProductElement>());

            // Events
            this.CreateEventsPanel(solutionBuilderModel, components, 2
                , component.Publishes.As<IProductElement>(), component.Subscribes.As<IProductElement>());

            // UseCases
            //this.CreateUseCasesPanel(solutionBuilderModel, component.As<IProductElement>(), application, 3);

            // Libraries
            this.CreateLibrariesPanel(solutionBuilderModel, component.As<IProductElement>(), application, 4);
        }
Esempio n. 3
0
        protected void CompareComponents <TComponent>(IComponent actual, IComponent expected)
            where TComponent : class, IComponent
        {
            actual.Should().BeOfType <TComponent>();

            actual.As <TComponent>().Should().BeEquivalentTo(expected.As <TComponent>());
        }