public void OperationalProcessTypeRefDataService_PurgeOrphans_Calls_Delete_Save()
 {
     _mockOperationalProcessTypeRefDataRepository.Setup(x => x.Delete(It.IsAny <OperationalProcessTypeRefData>())).Verifiable();
     _operationalProcessTypeRefDataService.PurgeOrphans();
     _mockOperationalProcessTypeRefDataRepository.Verify(x => x.Delete(It.IsAny <OperationalProcessTypeRefData>()), Times.Exactly(1));
     _unitOfWork.Verify(x => x.Save(), Times.Exactly(2));
 }
Beispiel #2
0
        public ActionResult Index(string level)
        {
            _operationalProcessTypeRefDataService.PurgeOrphans();
            //TODO: This needs to change now to show only the active resolver groups, any operational processes changes will be applied
            // to the resolvers containing the group
            var model = new ViewProcessDotMatrixViewModel
            {
                EditLevel = level
            };

            // Add the column for holding the ResolverId, which is actually the ServiceComponentId.
            model.Columns.Add(new DynamicGridColumn
            {
                Name     = DotMatrixNames.ResolverId,
                Title    = DotMatrixNames.ResolverId,
                Type     = typeof(int),
                Visible  = false,
                Editable = false
            });

            // Add the column for holding the Resolver Group name and Service Component Name
            model.Columns.Add(new DynamicGridColumn
            {
                Name     = DotMatrixNames.ResolverName,
                Title    = "Resolver Group",
                Type     = typeof(string),
                Editable = false
            });

            model.Columns.Add(new DynamicGridColumn
            {
                Name     = DotMatrixNames.ComponentName,
                Title    = "Service Component",
                Type     = typeof(string),
                Editable = false
            });

            // Now is the dynamic part. Need to have a column for all of the Operational Processes.
            var processes = _operationalProcessTypeRefDataService
                            .GetAllAndNotVisibleForCustomer(_appUserContext.Current.CurrentCustomer.Id)
                            .OrderBy(o => o.SortOrder);

            processes.ForEach(f => model.Columns.Add(new DynamicGridColumn
            {
                Name  = string.Concat(DotMatrixNames.OpIdPrefix, f.Id),
                Title = f.OperationalProcessTypeName,
                Type  = typeof(bool)
            }));

            return(View("DotMatrix" + level, model));
        }