public List <ChartDataListItem> Generate(int serviceDeskId, bool svcDomains = false, bool svcFunctions = false, bool svcComponents = false, bool resolvers = false, bool svcActivities = false, bool opProcs = false, string[] domainsSelected = null) { if (serviceDeskId == 0) { throw new ArgumentNullException(nameof(serviceDeskId)); } var diagram = new List <ChartDataListItem>(); var serviceDeskChart = new ChartDataListItem(); var serviceDesk = _serviceDeskService.GetById(serviceDeskId); if (serviceDesk != null) { serviceDeskChart.CreateServiceDeskWithInputs(serviceDesk); var serviceDomains = serviceDesk.ServiceDomains.ToList(); if (serviceDomains.Any()) { var serviceOrganisationListItems = _serviceComponentService.GetServiceOrganisationResolversByDesk(serviceDeskId, _serviceOrganisationDiagramtype); if (serviceOrganisationListItems.Any()) { if (resolvers) { // Resolvers and/or Service Components and/or Service Activities serviceOrganisationListItems.ProcessResolvers(svcComponents, svcActivities, _serviceOrganisationDiagramtype, serviceDesk.Customer.CustomerName, serviceDeskChart); } else if (svcComponents) { // Service Components and/or Service Activities serviceOrganisationListItems.ProcessResolverServiceComponents(svcActivities, _serviceOrganisationDiagramtype, serviceDeskChart); } else if (svcActivities) { // Service Activities only serviceOrganisationListItems.ProcessResolverServiceActivities(false, true, _serviceOrganisationDiagramtype, serviceDeskChart); } } } if (!serviceDeskChart.Units.Any()) { // Add Empty Unit var chartDataListItem = new ChartDataListItem { Id = 0, Title = string.Empty, CenteredTitle = string.Empty, Type = DecompositionType.EmptyForLayout.ToString(), Units = new List <ChartDataListItem>(), }; serviceDeskChart.Units.Add(chartDataListItem); } diagram.Add(serviceDeskChart); } return(diagram); }
public void ServiceComponentService_GetServiceOrganisationResolversByDesk_ReturnsListServiceOrganisationListItem() { #region Arrange #endregion #region Act var serviceOrganisationListItems = _target.GetServiceOrganisationResolversByDesk(1, ServiceDeliveryOrganisationNames.Fujitsu); #endregion #region Assert Assert.IsInstanceOfType(serviceOrganisationListItems, typeof(List <ServiceOrganisationListItem>)); #endregion }