Ejemplo n.º 1
0
        public void TestInitialize()
        {
            _mockUserService = new Mock <IUserService>();
            _mockTaskService = new Mock <ITaskService>();
            _mockSiteService = new Mock <IService <Site> >();

            _sites = new List <Site>
            {
                new Site
                {
                    Id    = 1,
                    Pin   = 12346,
                    Title = "Test"
                },
                new Site
                {
                    Id    = 1,
                    Pin   = 12347,
                    Title = "Test"
                }
            };

            _mockSiteRepository = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);
            _mockUnitOfWork     = new Mock <IUnitOfWork>();

            _siteService = new SiteService(_mockSiteRepository.Object, _mockUnitOfWork.Object);

            _operationTaskProcessor = new RestrictUser(_mockUserService.Object, _mockTaskService.Object, _siteService);
        }
Ejemplo n.º 2
0
        public void Intialize()
        {
            _timerLocks = new List <TimerLock>
            {
                new TimerLock
                {
                    Id             = 1,
                    LockedInstance = _guidOne,
                    LockedPin      = _lockedPinOne,
                    TaskId         = 1,
                    InsertedBy     = UserName,
                    InsertedDate   = _dateTime,
                    UpdatedBy      = UserName,
                    UpdatedDate    = _dateTime
                },
                new TimerLock
                {
                    Id             = 2,
                    LockedInstance = _guidTwo,
                    LockedPin      = _lockedPinTwo,
                    TaskId         = 2,
                    InsertedBy     = UserName,
                    InsertedDate   = _dateTime,
                    UpdatedBy      = UserName,
                    UpdatedDate    = _dateTime
                },
            };

            _mockUserIdentity = new Mock <IUserIdentity>();
            _mockUnitOfWork   = new Mock <IUnitOfWork>();

            _mockTimerLockRepository = MockRepositoryHelper.Create(_timerLocks, (entity, id) => entity.Id == (int)id);

            _timerLockService = new TimerLockService(_mockTimerLockRepository.Object, _mockUserIdentity.Object, _mockUnitOfWork.Object);
        }
Ejemplo n.º 3
0
        public void TestInitialize()
        {
            _mockPinService  = new Mock <IPinService>();
            _mockTaskService = new Mock <ITaskService>();
            _mockSiteService = new Mock <IService <Site> >();
            _mockUnitOfWork  = new Mock <IUnitOfWork>();

            _sites = new List <Site>
            {
                new Site
                {
                    Id    = 1,
                    Pin   = 123456,
                    Title = "Site - 123456"
                },
                new Site
                {
                    Id    = 2,
                    Pin   = 654321,
                    Title = "Site - 654321"
                }
            };

            _mockSiteRepository = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);
            _siteService        = new SiteService(_mockSiteRepository.Object, _mockUnitOfWork.Object);

            _operationTaskProcessor = new MergePin(_mockPinService.Object, _mockTaskService.Object, _siteService);
        }
Ejemplo n.º 4
0
        public void TestInitilize()
        {
            _regions = new List <RegionTypeRefData>
            {
                new RegionTypeRefData {
                    Id = 1, RegionName = "Americas", SortOrder = 5
                },
                new RegionTypeRefData {
                    Id = 2, RegionName = "Asia", SortOrder = 5
                },
                new RegionTypeRefData {
                    Id = 3, RegionName = "EMEIA", SortOrder = 5
                },
                new RegionTypeRefData {
                    Id = 4, RegionName = "Global Delivery", SortOrder = 5
                },
                new RegionTypeRefData {
                    Id = 5, RegionName = "Japan", SortOrder = 5
                },
                new RegionTypeRefData {
                    Id = 6, RegionName = "Ocenia", SortOrder = 5
                }
            };

            _mockRegionTypeRefDataRepository = MockRepositoryHelper.Create(_regions);
            _unitOfWork = new Mock <IUnitOfWork>();

            _regionTypeRefDataService = new RegionTypeRefDataService(_mockRegionTypeRefDataRepository.Object,
                                                                     _unitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 5
0
        public void Initialize()
        {
            _audits = new List <Audit>
            {
                UnitTestHelper.GenerateRandomData <Audit>(x =>
                {
                    x.Id = AuditId;
                }),
                UnitTestHelper.GenerateRandomData <Audit>(),
                UnitTestHelper.GenerateRandomData <Audit>(),
                UnitTestHelper.GenerateRandomData <Audit>()
            };

            _mockAuditRepository = MockRepositoryHelper.Create(_audits,
                                                               (entity, id) => entity.Id == (int)id,
                                                               (p1, p2) => p1.Id == p2.Id);

            _mockCustomerRepository = new Mock <IRepository <Customer> >();

            _mockUserIdentity = new Mock <IUserIdentity>();
            _mockUserIdentity.Setup(s => s.Name).Returns(UserName);

            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _target = new AuditService(_mockAuditRepository.Object,
                                       _mockCustomerRepository.Object,
                                       _mockUserIdentity.Object,
                                       _mockUnitOfWork.Object);
        }
Ejemplo n.º 6
0
        public void TestInitilize()
        {
            #region Test Data

            _templateRows = new List <TemplateRow>
            {
                UnitTestHelper.GenerateRandomData <TemplateRow>(x =>
                {
                    x.Id            = 1;
                    x.ServiceDomain = "Service Domain A";
                    x.TemplateId    = 1;
                }),
                UnitTestHelper.GenerateRandomData <TemplateRow>(x =>
                {
                    x.Id            = 2;
                    x.ServiceDomain = "Service Domain B";
                    x.TemplateId    = 1;
                }),
                UnitTestHelper.GenerateRandomData <TemplateRow>(x =>
                {
                    x.Id            = 3;
                    x.ServiceDomain = "Service Domain C";
                    x.TemplateId    = 1;
                }),
            };

            _templateDomainListItems = new List <TemplateDomainListItem>
            {
                new TemplateDomainListItem
                {
                    Id         = 1,
                    DomainName = "Service Domain A",
                    TemplateId = 1
                },
                new TemplateDomainListItem
                {
                    Id         = 2,
                    DomainName = "Service Domain B",
                    TemplateId = 1
                }
            };

            #endregion

            _mockTemplateRowRepository = MockRepositoryHelper.Create(_templateRows);
            _mockRepositoryTransaction = new Mock <IRepositoryTransaction>();

            _mockUnitOfWork = new Mock <IUnitOfWork>();
            _mockUnitOfWork.Setup(s => s.BeginTransaction()).Returns(_mockRepositoryTransaction.Object);
            _mockUnitOfWork.Setup(s => s.CreateConnection()).Returns(new SqlConnection());



            _mockTransformData = new Mock <ITransformTemplateToDesign>();


            _templateProcessor = new TemplateProcessor(_mockTemplateRowRepository.Object,
                                                       _mockTransformData.Object,
                                                       _mockUnitOfWork.Object);
        }
Ejemplo n.º 7
0
        public void Initialize()
        {
            _customerPacks = new List <CustomerPack>
            {
                UnitTestHelper.GenerateRandomData <CustomerPack>(x =>
                {
                    x.Id         = CustomerPackId;
                    x.CustomerId = CustomerId;
                }),
                UnitTestHelper.GenerateRandomData <CustomerPack>(),
                UnitTestHelper.GenerateRandomData <CustomerPack>(x =>
                {
                    x.CustomerId = CustomerId;
                }),
                UnitTestHelper.GenerateRandomData <CustomerPack>()
            };

            _mockCustomerPackRepository = MockRepositoryHelper.Create(_customerPacks,
                                                                      (entity, id) => entity.Id == (int)id,
                                                                      (p1, p2) => p1.Id == p2.Id);

            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _target = new CustomerPackService(_mockCustomerPackRepository.Object,
                                              _mockUnitOfWork.Object);
        }
Ejemplo n.º 8
0
        public void TestInitilize()
        {
            _assets = new List <Asset>
            {
                new Asset
                {
                    Id               = 1,
                    FileExtension    = ".mp4",
                    FileName         = Guid.NewGuid().ToString(),
                    OriginalFileName = "Register SLM Generator Tutorial",
                    MimeType         = "video/mp4",
                    FullPath         = "Fujitsu.SLM.Web.Tests\\Register SLM Generator Tutorial.mp4"
                },
                new Asset
                {
                    Id               = 2,
                    FileExtension    = ".mp4",
                    FileName         = Guid.NewGuid().ToString(),
                    OriginalFileName = "ChangePassword",
                    MimeType         = "video/mp4",
                    FullPath         = "C:\\Media\\Video\\ChangePassword.mp4"
                }
            };

            _mockAssetRepository = MockRepositoryHelper.Create(_assets);
            _mockContextHelpRefDataRepository = new Mock <IRepository <ContextHelpRefData> >();
            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _assetService = new AssetService(
                _mockAssetRepository.Object,
                _mockContextHelpRefDataRepository.Object,
                _mockUnitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 9
0
        public void Initialize()
        {
            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _mockCacheManager = new Mock <ICacheManager>();

            _mockUserIdentity = new Mock <IUserIdentity>();
            _mockUserIdentity.Setup(s => s.Name).Returns(UserName);

            _parameters = new List <Parameter>
            {
                UnitTestHelper.GenerateRandomData <Parameter>(),
                UnitTestHelper.GenerateRandomData <Parameter>(),
                UnitTestHelper.GenerateRandomData <Parameter>(x => x.Id = ExistingId),
                UnitTestHelper.GenerateRandomData <Parameter>(x =>
                {
                    x.Name  = ExistingParameterName;
                    x.Value = ExistingParameterValue;
                }),
                UnitTestHelper.GenerateRandomData <Parameter>()
            };

            _mockParameterRepository = MockRepositoryHelper.Create(_parameters,
                                                                   (entity, id) => entity.Id == (int)id,
                                                                   (p1, p2) => p1.Id == p2.Id);

            _parameterService = new ParameterService(_mockParameterRepository.Object,
                                                     _mockUnitOfWork.Object,
                                                     _mockUserIdentity.Object,
                                                     _mockCacheManager.Object);
        }
        public void TestInitialize()
        {
            _historyLogs = new List <HistoryLog>
            {
                new HistoryLog
                {
                    Id          = 1,
                    Name        = TaskNames.AllocatePin,
                    Handler     = TaskHandlerNames.OperationsHandler,
                    EventDetail =
                        string.Format(TaskResources.OperationsTaskRequest_InvalidRequestNoPin, TaskNames.AllocatePin),
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime,
                    Escalated    = false
                },
                new HistoryLog
                {
                    Id          = 2,
                    Name        = TaskNames.AllocatePin,
                    Handler     = TaskHandlerNames.OperationsHandler,
                    EventDetail =
                        string.Format(TaskResources.OperationsTaskRequest_InvalidRequestNoSiteTitle,
                                      TaskNames.AllocatePin, PIN),
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime,
                    Escalated    = false
                },
                new HistoryLog
                {
                    Id          = 3,
                    Name        = TaskNames.AllocatePin,
                    Handler     = TaskHandlerNames.OperationsHandler,
                    EventDetail =
                        string.Format(TaskResources.OperationsTaskRequest_InvalidRequestNoSiteTitle,
                                      TaskNames.AllocatePin, PIN),
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime,
                    Escalated    = true
                }
            };

            _mockSupportService       = new Mock <ISupportService>();
            _mockHistoryLogService    = new Mock <IService <HistoryLog> >();
            _mockHistoryLogRepository = MockRepositoryHelper.Create(_historyLogs, (entity, id) => entity.Id == (int)id);
            _mockUnitOfWork           = new Mock <IUnitOfWork>();

            _supportTaskProcessor = new HistoryErrorLogMonitoring(_mockSupportService.Object, _mockHistoryLogService.Object);
        }
        public void TestInitilize()
        {
            _unitOfWork = new Mock <IUnitOfWork>();

            _inputTypes = new List <InputTypeRefData>
            {
                new InputTypeRefData {
                    Id = 1, InputTypeNumber = 1, InputTypeName = "Input A", SortOrder = 5
                },
                new InputTypeRefData {
                    Id = 2, InputTypeNumber = 2, InputTypeName = "Input B", SortOrder = 5
                },
                new InputTypeRefData {
                    Id = 3, InputTypeNumber = 3, InputTypeName = "Input C", SortOrder = 5
                },
                new InputTypeRefData {
                    Id = 4, InputTypeNumber = 4, InputTypeName = "Input D", SortOrder = 5
                }
            };

            _mockInputTypeRefDataRepository = MockRepositoryHelper.Create(_inputTypes);

            _deskInputTypes = new List <DeskInputType>
            {
                UnitTestHelper.GenerateRandomData <DeskInputType>(x =>
                {
                    x.Id = 1;
                    x.InputTypeRefData = _inputTypes.First(y => y.Id == 1);
                }),
                UnitTestHelper.GenerateRandomData <DeskInputType>(x =>
                {
                    x.Id = 2;
                    x.InputTypeRefData = _inputTypes.First(y => y.Id == 1);
                }),
                UnitTestHelper.GenerateRandomData <DeskInputType>(x =>
                {
                    x.Id = 3;
                    x.InputTypeRefData = _inputTypes.First(y => y.Id == 1);
                }),
                UnitTestHelper.GenerateRandomData <DeskInputType>(x =>
                {
                    x.Id = 4;
                    x.InputTypeRefData = _inputTypes.First(y => y.Id == 3);
                }),
            };

            _mockDeskInputTypeRepository = MockRepositoryHelper.Create(_deskInputTypes);

            _inputTypeRefDataService = new InputTypeRefDataService(
                _mockInputTypeRefDataRepository.Object, _mockDeskInputTypeRepository.Object, _unitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 12
0
        public void TestInitilize()
        {
            var dateTimeNow = DateTime.Now;

            _templates = new List <Template>
            {
                new Template
                {
                    Id           = 1,
                    Filename     = "templateOne.xls",
                    TemplateData = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 },
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow
                },
                new Template
                {
                    Id           = 2,
                    Filename     = "templateTwo.xls",
                    TemplateData = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 },
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow
                },
                new Template
                {
                    Id           = 3,
                    Filename     = "templateThree.xls",
                    TemplateData = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 },
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow
                }
            };

            _mockTemplateRepository       = MockRepositoryHelper.Create(_templates);
            _mockTemplateDomainRepository = new Mock <IRepository <TemplateDomain> >();
            _mockTemplateRowRepository    = new Mock <IRepository <TemplateRow> >();
            _mockUnitOfWork = new Mock <IUnitOfWork>();


            _templateService = new TemplateService(
                _mockTemplateRepository.Object,
                _mockTemplateDomainRepository.Object,
                _mockTemplateRowRepository.Object,
                _mockUnitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 13
0
        public void TestInitilize()
        {
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            var dateTimeNow = DateTime.Now;

            _serviceDesks = new List <ServiceDesk>
            {
                new ServiceDesk
                {
                    Id           = 1,
                    DeskName     = "Fujitsu ING Service Desk",
                    CustomerId   = 1,
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow,
                },
                new ServiceDesk
                {
                    Id           = 2,
                    DeskName     = "Fujitsu 3663 Service Desk",
                    CustomerId   = 2,
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow,
                },
                new ServiceDesk
                {
                    Id           = 99,
                    DeskName     = "Fujitsu 3663 Service Desk",
                    CustomerId   = 2,
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow,
                },
            };


            _mockServiceDeskRepository   = MockRepositoryHelper.Create(_serviceDesks, (entity, id) => entity.Id == (int)id);
            _mockDeskInputTypeRepository = new Mock <IRepository <DeskInputType> >();

            _serviceDeskService = new ServiceDeskService(
                _mockServiceDeskRepository.Object,
                _mockDeskInputTypeRepository.Object,
                _mockUnitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 14
0
        public void TestInitialize()
        {
            _timerLocks = new List <TimerLock>
            {
                new TimerLock
                {
                    LockedInstance = _serviceInstanceOne,
                    LockedPin      = _lockedPinOne
                }
            };

            _mockTimerLockRepository = MockRepositoryHelper.Create(_timerLocks, (entity, id) => entity.Id == (int)id);

            _taskHandler = new TestTaskHandler();
        }
Ejemplo n.º 15
0
        public void TestInitilize()
        {
            _unitOfWork = new Mock <IUnitOfWork>();

            _serviceDeliveryOrganisationTypeRefDatas = new List <ServiceDeliveryOrganisationTypeRefData>
            {
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 1, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation A", SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 2, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation B", SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 3, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation C", SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData {
                    Id = 4, ServiceDeliveryOrganisationTypeName = "ServiceDeliveryOrganisation D", SortOrder = 5
                },
            };

            _resolvers = new List <Resolver>
            {
                UnitTestHelper.GenerateRandomData <Resolver>(),
                UnitTestHelper.GenerateRandomData <Resolver>(x =>
                {
                    x.ServiceDeliveryOrganisationType = UnitTestHelper
                                                        .GenerateRandomData <ServiceDeliveryOrganisationTypeRefData>(
                        y =>
                    {
                        y.Id = ServiceDeliveryOrganisationTypeIdInUse;
                        y.ServiceDeliveryOrganisationTypeName = "XYZ";
                    });
                }),
                UnitTestHelper.GenerateRandomData <Resolver>(),
                UnitTestHelper.GenerateRandomData <Resolver>(),
                UnitTestHelper.GenerateRandomData <Resolver>()
            };

            _serviceDeliveryOrganisationTypeRefDataRepository = MockRepositoryHelper.Create(_serviceDeliveryOrganisationTypeRefDatas, (entity, id) => entity.Id == (int)id);

            _resolverRepository = MockRepositoryHelper.Create(_resolvers, (entity, id) => entity.Id == (int)id);

            _serviceDeliveryOrganisationRefDataService = new ServiceDeliveryOrganisationTypeRefDataService(_serviceDeliveryOrganisationTypeRefDataRepository.Object,
                                                                                                           _resolverRepository.Object,
                                                                                                           _unitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 16
0
        public void Intialize()
        {
            _sites = new List <Site>();



            _mockUnitOfWork       = new Mock <IUnitOfWork>();
            _mockUserIdentity     = new Mock <IUserIdentity>();
            _mockParameterService = new Mock <IParameterService>();
            _mockContextService   = new Mock <IContextService>();

            _mockLibraryRepository = new Mock <IRepository <Library> >();

            _mockSiteRepository = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);
            _mockSiteRepository = new Mock <IRepository <Site> >();
            _userService        = new UserService(_mockParameterService.Object, _mockContextService.Object, _mockSiteRepository.Object, _mockLibraryRepository.Object, _mockUserIdentity.Object, _mockUnitOfWork.Object);
        }
Ejemplo n.º 17
0
        public void TestInitialize()
        {
            _mockCaseService    = new Mock <ICaseService>();
            _mockTaskService    = new Mock <ITaskService>();
            _mockSiteService    = new Mock <IService <Site> >();
            _mockLibraryService = new Mock <ILibraryService>();

            _sites = new List <Site>
            {
                new Site
                {
                    Id    = 1,
                    Pin   = 12346,
                    Title = "Test"
                },
                new Site
                {
                    Id    = 1,
                    Pin   = 12347,
                    Title = "Test"
                }
            };

            _libraries = new List <Library>
            {
                new Library
                {
                    Id        = 1,
                    SiteId    = 1,
                    Site      = _sites.First(x => x.Id == 1),
                    CaseId    = 12345,
                    ProjectId = 1,
                    Title     = "Library One"
                }
            };

            _mockSiteRepository    = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);
            _mockLibraryRepository = MockRepositoryHelper.Create(_libraries, (entity, id) => entity.Id == (int)id);
            _mockUnitOfWork        = new Mock <IUnitOfWork>();

            _libraryService = new LibraryService(_mockTaskService.Object, _mockLibraryRepository.Object, _mockUnitOfWork.Object);
            _siteService    = new SiteService(_mockSiteRepository.Object, _mockUnitOfWork.Object);

            _operationTaskProcessor = new CloseCase(_mockCaseService.Object, _mockTaskService.Object, _libraryService, _siteService);
        }
Ejemplo n.º 18
0
        public void Intialize()
        {
            _sites = new List <Site>
            {
                new Site
                {
                    Id           = 1,
                    Url          = "https://fujitsuuki.sharepoint.com/sites/DCF-T1/12345",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new Site
                {
                    Id           = 2,
                    Url          = "https://fujitsuuki.sharepoint.com/sites/DCF-T1/23456",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new Site
                {
                    Id           = 3,
                    Url          = "https://fujitsuuki.sharepoint.com/sites/DCF-T1/34567",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                }
            };

            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _mockSiteRepository = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);

            _siteService = new SiteService(_mockSiteRepository.Object, _mockUnitOfWork.Object);

            Bootstrapper.Initialise();
        }
Ejemplo n.º 19
0
        public void TestInitilize()
        {
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            var dateTimeNow = DateTime.Now;

            _contributors = new List <Contributor>
            {
                new Contributor
                {
                    Id           = 1,
                    CustomerId   = 1,
                    UserId       = UserIdOne,
                    EmailAddress = UserNameOne,
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow,
                },
                new Contributor
                {
                    Id           = 1,
                    CustomerId   = 1,
                    UserId       = UserIdTwo,
                    EmailAddress = UserNameTwo,
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow,
                },
            };


            _mockContributorRepository = MockRepositoryHelper.Create(_contributors, (entity, id) => entity.Id == (int)id);

            _contributorService = new ContributorService(
                _mockContributorRepository.Object, _mockUnitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 20
0
        public void TestInitialize()
        {
            _mockPinService  = new Mock <IPinService>();
            _mockTaskService = new Mock <ITaskService>();
            _mockSiteService = new Mock <IService <Site> >();
            _mockUnitOfWork  = new Mock <IUnitOfWork>();

            _sites = new List <Site>
            {
                new Site
                {
                    Id    = 1,
                    Pin   = 12345,
                    Title = "Test"
                }
            };

            _mockSiteRepository = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);
            _siteService        = new SiteService(_mockSiteRepository.Object, _mockUnitOfWork.Object);

            _operationTaskProcessor = new UpdatePinWithDictionaryValues(_mockPinService.Object, _mockTaskService.Object, _siteService);
        }
        public void TestInitilize()
        {
            _contextHelpRefData = new List <ContextHelpRefData>
            {
                new ContextHelpRefData
                {
                    Id       = 1,
                    HelpText = "This is help for the <b>Home Page</b>.",
                    Key      = "homepage",
                    Title    = "Home Page Help",
                },
            };

            _mockContextHelpRefDataRepository = MockRepositoryHelper.Create(_contextHelpRefData);

            _unitOfWork = new Mock <IUnitOfWork>();


            _contextHelpRefDataService = new ContextHelpRefDataService(_mockContextHelpRefDataRepository.Object,
                                                                       _unitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
        public void TestInitilize()
        {
            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _serviceDeliveryUnitTypeRefDatas = new List <ServiceDeliveryUnitTypeRefData>
            {
                new ServiceDeliveryUnitTypeRefData {
                    Id = ServiceDeliveryUnitTypeRefDataIdInUse, ServiceDeliveryUnitTypeName = "ServiceDeliveryUnit A", SortOrder = 5, Visible = true
                },
                new ServiceDeliveryUnitTypeRefData {
                    Id = 2, ServiceDeliveryUnitTypeName = "ServiceDeliveryUnit B", SortOrder = 5, Visible = true
                },
                new ServiceDeliveryUnitTypeRefData {
                    Id = 3, ServiceDeliveryUnitTypeName = "ServiceDeliveryUnit C", SortOrder = 5, Visible = true
                },
                new ServiceDeliveryUnitTypeRefData {
                    Id = 4, ServiceDeliveryUnitTypeName = "ServiceDeliveryUnit D", SortOrder = 5, Visible = true
                },
                new ServiceDeliveryUnitTypeRefData {
                    Id = 5, ServiceDeliveryUnitTypeName = "ServiceDeliveryUnit E", SortOrder = 5, Visible = false
                },
                new ServiceDeliveryUnitTypeRefData {
                    Id = ServiceDeliveryUnitTypeRefDataIdNotInUse, ServiceDeliveryUnitTypeName = "ServiceDeliveryUnit F", SortOrder = 5, Visible = false
                },
                new ServiceDeliveryUnitTypeRefData {
                    Id = 7, ServiceDeliveryUnitTypeName = "ServiceDeliveryUnit G", SortOrder = 5, Visible = true
                }
            };

            _resolvers = new List <Resolver>
            {
                UnitTestHelper.GenerateRandomData <Resolver>(x =>
                {
                    x.ServiceDesk             = UnitTestHelper.GenerateRandomData <ServiceDesk>();
                    x.ServiceDesk.CustomerId  = CustomerId;
                    x.ServiceDeliveryUnitType = _serviceDeliveryUnitTypeRefDatas.First(y => y.Id == 2);
                }),
                UnitTestHelper.GenerateRandomData <Resolver>(x =>
                {
                    x.ServiceDesk             = UnitTestHelper.GenerateRandomData <ServiceDesk>();
                    x.ServiceDesk.CustomerId  = CustomerId;
                    x.ServiceDeliveryUnitType = _serviceDeliveryUnitTypeRefDatas.First(y => y.Id == 3);
                }),
                UnitTestHelper.GenerateRandomData <Resolver>(x =>
                {
                    x.ServiceDesk             = UnitTestHelper.GenerateRandomData <ServiceDesk>();
                    x.ServiceDesk.CustomerId  = CustomerId;
                    x.ServiceDeliveryUnitType = _serviceDeliveryUnitTypeRefDatas.First(y => y.Id == ServiceDeliveryUnitTypeRefDataIdInUse);
                }),
                UnitTestHelper.GenerateRandomData <Resolver>(x =>
                {
                    x.ServiceDesk             = UnitTestHelper.GenerateRandomData <ServiceDesk>();
                    x.ServiceDesk.CustomerId  = CustomerId;
                    x.ServiceDeliveryUnitType = _serviceDeliveryUnitTypeRefDatas.First(y => y.Id == 5);
                }),
                UnitTestHelper.GenerateRandomData <Resolver>(x =>
                {
                    x.ServiceDesk             = UnitTestHelper.GenerateRandomData <ServiceDesk>();
                    x.ServiceDesk.CustomerId  = 1;
                    x.ServiceDeliveryUnitType = _serviceDeliveryUnitTypeRefDatas.First(y => y.Id == ServiceDeliveryUnitTypeRefDataIdInUse);
                }),
            };

            _mockServiceDeliveryUnitRefDataRepository = MockRepositoryHelper.Create(_serviceDeliveryUnitTypeRefDatas);

            _mockServiceDeliveryUnitRepository = MockRepositoryHelper.Create(_resolvers);

            _mockParameterService = new Mock <IParameterService>();

            _serviceDeliveryUnitRefDataService = new ServiceDeliveryUnitTypeRefDataService(_mockServiceDeliveryUnitRefDataRepository.Object,
                                                                                           _mockServiceDeliveryUnitRepository.Object,
                                                                                           _mockParameterService.Object,
                                                                                           _mockUnitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 23
0
        public void TestInitialize()
        {
            _mockCaseService      = new Mock <ICaseService>();
            _mockTaskService      = new Mock <ITaskService>();
            _mockLibraryService   = new Mock <ILibraryService>();
            _mockParameterService = new Mock <IParameterService>();

            _sites = new List <Site>
            {
                new Site
                {
                    Id    = 1,
                    Pin   = 12346,
                    Title = "Test"
                },
                new Site
                {
                    Id    = 2,
                    Pin   = 12347,
                    Title = "Test"
                }
            };

            _libraries = new List <Library>
            {
                new Library
                {
                    Id          = 1,
                    SiteId      = 1,
                    Site        = _sites.First(x => x.Id == 1),
                    CaseId      = 12345,
                    ProjectId   = 1,
                    Title       = "Library One",
                    IsClosed    = true,
                    UpdatedDate = DateTime.Now.AddYears(-26)
                },
                new Library
                {
                    Id          = 2,
                    SiteId      = 2,
                    Site        = _sites.First(x => x.Id == 2),
                    CaseId      = 12346,
                    ProjectId   = 1,
                    Title       = "Library Two",
                    IsClosed    = true,
                    UpdatedDate = DateTime.Now.AddYears(-27)
                },
                new Library
                {
                    Id          = 3,
                    SiteId      = 2,
                    Site        = _sites.First(x => x.Id == 2),
                    CaseId      = 12347,
                    ProjectId   = 1,
                    Title       = "Library Three",
                    IsClosed    = false,
                    UpdatedDate = DateTime.Now
                },
                new Library
                {
                    Id          = 4,
                    SiteId      = 2,
                    Site        = _sites.First(x => x.Id == 2),
                    CaseId      = 12346,
                    ProjectId   = 1,
                    Title       = "Library Four",
                    IsClosed    = true,
                    UpdatedDate = DateTime.Now.AddYears(5)
                }
            };

            _mockSiteRepository    = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);
            _mockLibraryRepository = MockRepositoryHelper.Create(_libraries, (entity, id) => entity.Id == (int)id);
            _mockUnitOfWork        = new Mock <IUnitOfWork>();
            _libraryService        = new LibraryService(_mockTaskService.Object, _mockLibraryRepository.Object, _mockUnitOfWork.Object);

            _operationTaskProcessor = new DeleteCase(_mockCaseService.Object, _libraryService, _mockParameterService.Object);
        }
Ejemplo n.º 24
0
        public void Intialize()
        {
            _sites = new List <Site>
            {
                new Site
                {
                    Id           = 1,
                    Url          = "https://fujitsuuki.sharepoint.com/sites/DCF-T1/12345",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new Site
                {
                    Id           = 2,
                    Url          = "https://fujitsuuki.sharepoint.com/sites/DCF-T1/23456",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new Site
                {
                    Id           = 3,
                    Url          = "https://fujitsuuki.sharepoint.com/sites/DCF-T1/34567",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                }
            };

            _libraries = new List <Library>
            {
                new Library
                {
                    Id           = 1,
                    SiteId       = 1,
                    Site         = _sites.First(x => x.Id == 1),
                    CaseId       = 1,
                    ProjectId    = 1,
                    Title        = "Library One",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new Library
                {
                    Id           = 2,
                    SiteId       = 2,
                    Site         = _sites.First(x => x.Id == 2),
                    CaseId       = 2,
                    ProjectId    = 2,
                    Title        = "Library Two",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new Library
                {
                    Id           = 3,
                    SiteId       = 1,
                    Site         = _sites.First(x => x.Id == 1),
                    CaseId       = 3,
                    ProjectId    = 3,
                    Title        = "Library Three",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                }
            };

            _mockUnitOfWork        = new Mock <IUnitOfWork>();
            _mockUserIdentity      = new Mock <IUserIdentity>();
            _mockParameterService  = new Mock <IParameterService>();
            _mockSiteRepository    = MockRepositoryHelper.Create(_sites);
            _mockLibraryRepository = MockRepositoryHelper.Create(_libraries);
            _mockLibraryService    = new Mock <ILibraryService>();
            _mockContextService    = new Mock <IContextService>();

            _caseService = new CaseService(_mockParameterService.Object, _mockContextService.Object, _mockLibraryService.Object, _mockSiteRepository.Object, _mockLibraryRepository.Object, _mockUserIdentity.Object, _mockUnitOfWork.Object);

            Bootstrapper.Initialise();
        }
Ejemplo n.º 25
0
        public void Initialize()
        {
            var container = new ObjectBuilder(ObjectBuilderHelper.SetupObjectBuilder).GetContainer();

            Logger.SetLogWriter(new LogWriterFactory().Create(), false);

            var config  = ConfigurationSourceFactory.Create();
            var factory = new ExceptionPolicyFactory(config);

            var exceptionManager = factory.CreateManager();

            container.RegisterInstance(exceptionManager);

            ExceptionPolicy.SetExceptionManager(exceptionManager, false);

            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _appContext = new AppContext();

            _mockAppUserContext = new Mock <IAppUserContext>();
            _mockAppUserContext.Setup(s => s.Current).Returns(_appContext);


            _mockContextManager  = new Mock <IContextManager>();
            _mockResponseManager = new Mock <IResponseManager>();
            _mockContextManager.Setup(s => s.ResponseManager).Returns(_mockResponseManager.Object);

            _contextHelpRefData = new List <ContextHelpRefData>
            {
                new ContextHelpRefData
                {
                    Id       = 1,
                    Key      = "homepage",
                    Title    = "Homepage",
                    HelpText = "This is the <b>Home Page</b> help.",
                    AssetId  = 1,
                    Asset    = new Asset {
                        Id               = 1,
                        FileExtension    = ".mp4",
                        FileName         = Guid.NewGuid().ToString(),
                        OriginalFileName = "Register SLM Generator Tutorial",
                        MimeType         = "video/mp4",
                        FullPath         = "Fujitsu.SLM.Web.Tests\\Register SLM Generator Tutorial.mp4"
                    }
                },
                new ContextHelpRefData
                {
                    Id       = 2,
                    Key      = "changepasswordpage",
                    Title    = "ChangePasswordPage",
                    HelpText = "This is the <b>Change Password</b> help.",
                    AssetId  = 2,
                    Asset    = new Asset {
                        Id               = 2,
                        FileExtension    = ".mp4",
                        FileName         = Guid.NewGuid().ToString(),
                        OriginalFileName = "ChangePassword",
                        MimeType         = "video/mp4",
                        FullPath         = "C:\\Media\\Video\\ChangePassword.mp4"
                    }
                }
            };

            _mockContextHelpRefDataRepository = MockRepositoryHelper.Create(_contextHelpRefData, (entity, id) => entity.Id == (int)id);

            _mockContextHelpRefDataService = new Mock <IContextHelpRefDataService>();
            _mockContextHelpRefDataService.Setup(s => s.GetByHelpKey("homepage")).Returns(_contextHelpRefData[0]);
            _mockContextHelpRefDataService.Setup(s => s.GetById(It.IsAny <int>()))
            .Returns <int>(id => _contextHelpRefData.SingleOrDefault(x => x.Id == id));

            _mockAssetRepository = new Mock <IRepository <Asset> >();

            _mockController = new HelpController(
                _mockContextHelpRefDataService.Object,
                _mockAssetRepository.Object,
                _mockContextManager.Object
                );

            _contextHelpRefDataService = new ContextHelpRefDataService(_mockContextHelpRefDataRepository.Object,
                                                                       _mockUnitOfWork.Object);

            _controller = new HelpController(
                _contextHelpRefDataService,
                _mockAssetRepository.Object,
                _mockContextManager.Object
                );

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 26
0
        public void TestInitilize()
        {
            #region Desk Input Types

            _deskInputTypes = new List <DeskInputType>
            {
                new DeskInputType
                {
                    Id = 1,
                    InputTypeRefData =
                        new InputTypeRefData {
                        Id = 1, InputTypeNumber = 1, InputTypeName = "Incident", SortOrder = 5
                    }
                },
                new DeskInputType
                {
                    Id = 2,
                    InputTypeRefData =
                        new InputTypeRefData {
                        Id = 2, InputTypeNumber = 2, InputTypeName = "Event", SortOrder = 5
                    }
                },
                new DeskInputType
                {
                    Id = 3,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 3,
                        InputTypeNumber = 3,
                        InputTypeName   = "Authorized Request",
                        SortOrder       = 5
                    }
                },
                new DeskInputType
                {
                    Id = 4,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 4,
                        InputTypeNumber = 4,
                        InputTypeName   = "How do I.. Questions",
                        SortOrder       = 5
                    }
                },
                new DeskInputType
                {
                    Id = 5,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 5,
                        InputTypeNumber = 5,
                        InputTypeName   = "Authorized Standard Change",
                        SortOrder       = 5
                    }
                },
                new DeskInputType
                {
                    Id = 6,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 6,
                        InputTypeNumber = 6,
                        InputTypeName   = "Authorized Non-Standard Change",
                        SortOrder       = 5
                    }
                }
            };

            #endregion

            #region Service Domain Types

            _serviceDomainTypes = new List <DomainTypeRefData>
            {
                new DomainTypeRefData {
                    Id = 1, DomainName = "Service Desk", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 2, DomainName = "Infrastructure as a Service", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 3, DomainName = "Service Delivery Management", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 4, DomainName = "Infrastructure Management", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 5, DomainName = "End User Device Services", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 6, DomainName = "Engineering Services", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 7, DomainName = "Programme Management Office", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 8, DomainName = "Consulting Services", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 9, DomainName = "Bill of material components", SortOrder = 5, Visible = true
                }
            };

            #endregion

            #region Service Function Types

            _serviceFunctionTypes = new List <FunctionTypeRefData>
            {
                new FunctionTypeRefData {
                    Id = 1, FunctionName = "System Management Infrastructure", SortOrder = 5, Visible = true
                },
                new FunctionTypeRefData {
                    Id = 2, FunctionName = "Desktop Virtualisation", SortOrder = 5, Visible = true
                },
                new FunctionTypeRefData {
                    Id = 3, FunctionName = "Secure Remote Access", SortOrder = 5, Visible = true
                },
                new FunctionTypeRefData {
                    Id = 4, FunctionName = "Computing Management", SortOrder = 5, Visible = true
                },
                new FunctionTypeRefData {
                    Id = 5, FunctionName = "General Services", SortOrder = 5, Visible = true
                },
                new FunctionTypeRefData {
                    Id = 6, FunctionName = "Network Services Tower A", SortOrder = 5, Visible = true
                },
                new FunctionTypeRefData {
                    Id = 7, FunctionName = "Network Services Tower B", SortOrder = 5, Visible = true
                }
            };

            #endregion

            #region Service Delivery Organisation Types

            _serviceDeliveryOrganisationTypes = new List <ServiceDeliveryOrganisationTypeRefData>
            {
                new ServiceDeliveryOrganisationTypeRefData
                {
                    Id = 1,
                    ServiceDeliveryOrganisationTypeName = "Fujitsu",
                    SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData
                {
                    Id = 2,
                    ServiceDeliveryOrganisationTypeName = "Customer",
                    SortOrder = 5
                },
                new ServiceDeliveryOrganisationTypeRefData
                {
                    Id = 3,
                    ServiceDeliveryOrganisationTypeName = "Customer Third Party",
                    SortOrder = 5
                },
            };

            #endregion

            #region Service Delivery Unit Types

            _serviceDeliveryUnitTypes = new List <ServiceDeliveryUnitTypeRefData>
            {
                new ServiceDeliveryUnitTypeRefData
                {
                    Id = 1,
                    ServiceDeliveryUnitTypeName = "Verizon",
                    SortOrder = 5
                },
                new ServiceDeliveryUnitTypeRefData
                {
                    Id = 2,
                    ServiceDeliveryUnitTypeName = "HP",
                    SortOrder = 5
                },
                new ServiceDeliveryUnitTypeRefData
                {
                    Id = 3,
                    ServiceDeliveryUnitTypeName = "Cisco",
                    SortOrder = 5
                },
                new ServiceDeliveryUnitTypeRefData
                {
                    Id = 4,
                    ServiceDeliveryUnitTypeName = "SAP",
                    SortOrder = 5
                },
                new ServiceDeliveryUnitTypeRefData
                {
                    Id = 5,
                    ServiceDeliveryUnitTypeName = "Business Apps",
                    SortOrder = 5
                },
                new ServiceDeliveryUnitTypeRefData
                {
                    Id = 6,
                    ServiceDeliveryUnitTypeName = "Facilities",
                    SortOrder = 5
                },
                new ServiceDeliveryUnitTypeRefData
                {
                    Id = 7,
                    ServiceDeliveryUnitTypeName = "Oracle",
                    SortOrder = 5
                },
            };

            #endregion

            #region Resolver Groups

            _resolverGroupTypes = new List <ResolverGroupTypeRefData>
            {
                new ResolverGroupTypeRefData {
                    Id = 1, ResolverGroupTypeName = "Wintel Team", SortOrder = 5
                },
                new ResolverGroupTypeRefData {
                    Id = 2, ResolverGroupTypeName = "Oracle Team", SortOrder = 10
                },
                new ResolverGroupTypeRefData {
                    Id = 3, ResolverGroupTypeName = "On-Site Support Dispatch", SortOrder = 15
                },
                new ResolverGroupTypeRefData {
                    Id = 4, ResolverGroupTypeName = "On-Site Support Permanent", SortOrder = 15
                },
                new ResolverGroupTypeRefData {
                    Id = 5, ResolverGroupTypeName = "Off-Site Support Dispatch", SortOrder = 15
                },
                new ResolverGroupTypeRefData {
                    Id = 6, ResolverGroupTypeName = "Off-Site Support Permanent", SortOrder = 15
                },
            };

            #endregion

            #region Service Desks

            _serviceDesks = new List <ServiceDesk>
            {
                new ServiceDesk
                {
                    Id         = 1,
                    DeskName   = "Service Desk A With Inputs",
                    CustomerId = 1,
                    Customer   = UnitTestHelper.GenerateRandomData <Customer>(c =>
                    {
                        c.Id           = 1;
                        c.CustomerName = "3663";
                    }),
                    DeskInputTypes = new List <DeskInputType>
                    {
                        _deskInputTypes.FirstOrDefault(x => x.Id == 1),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 2),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 3),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 4),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 5),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 6)
                    },
                    ServiceDomains = new List <ServiceDomain>()
                },
                new ServiceDesk
                {
                    Id         = 2,
                    DeskName   = "Service Desk B With Domains",
                    CustomerId = 2,
                    Customer   = UnitTestHelper.GenerateRandomData <Customer>(c =>
                    {
                        c.Id           = 2;
                        c.CustomerName = "Robeco";
                    }),
                    ServiceDomains = new List <ServiceDomain>
                    {
                        new ServiceDomain
                        {
                            Id = 1,
                            AlternativeName  = "Domain A",
                            DomainType       = _serviceDomainTypes.FirstOrDefault(x => x.Id == 1),
                            ServiceFunctions = new List <ServiceFunction>
                            {
                                new ServiceFunction
                                {
                                    Id = 1,
                                    AlternativeName = "Function A",
                                    FunctionType    = _serviceFunctionTypes.FirstOrDefault(x => x.Id == 1),
                                },
                                new ServiceFunction
                                {
                                    Id = 2,
                                    AlternativeName = "Function B",
                                    FunctionType    = _serviceFunctionTypes.FirstOrDefault(x => x.Id == 2)
                                }
                            }
                        },
                        new ServiceDomain
                        {
                            Id               = 2,
                            DomainType       = _serviceDomainTypes.FirstOrDefault(x => x.Id == 2),
                            ServiceFunctions = new List <ServiceFunction>
                            {
                                new ServiceFunction
                                {
                                    Id = 3,
                                    AlternativeName = "Function C",
                                    FunctionType    = _serviceFunctionTypes.FirstOrDefault(x => x.Id == 3),
                                },
                                new ServiceFunction
                                {
                                    Id = 2,
                                    AlternativeName = "Function D",
                                    FunctionType    = _serviceFunctionTypes.FirstOrDefault(x => x.Id == 4)
                                }
                            }
                        },
                        new ServiceDomain
                        {
                            Id         = 3,
                            DomainType = new DomainTypeRefData
                            {
                                Id         = 3,
                                DomainName = "Domain C",
                                SortOrder  = 5,
                                Visible    = true,
                            }
                        }
                    }
                }
            };

            #endregion

            #region Service Components

            _serviceComponents = new List <ServiceComponent>
            {
                new ServiceComponent
                {
                    Id                = 1,
                    ComponentLevel    = 1,
                    ComponentName     = "Component A",
                    ServiceActivities = "- Activity One\r\n- Activity Two",
                    ServiceFunction   = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                    Resolver          = new Resolver
                    {
                        Id = 1,
                        ServiceDeliveryOrganisationType =
                            _serviceDeliveryOrganisationTypes.FirstOrDefault(x => x.Id == 1),
                        ServiceDeliveryUnitType = _serviceDeliveryUnitTypes.FirstOrDefault(x => x.Id == 1),
                        ResolverGroupType       = _resolverGroupTypes.FirstOrDefault(x => x.Id == 1),
                    }
                },
                new ServiceComponent
                {
                    Id              = 2,
                    ComponentLevel  = 1,
                    ComponentName   = "Component B",
                    ServiceFunction = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                }
            };

            _serviceComponents.Add(
                new ServiceComponent
            {
                Id                     = 3,
                ComponentLevel         = 2,
                ComponentName          = "Component C",
                ServiceActivities      = "- Activity Three",
                ServiceFunction        = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                ParentServiceComponent = _serviceComponents[1],
                Resolver               = new Resolver
                {
                    Id = 2,
                    ServiceDeliveryOrganisationType =
                        _serviceDeliveryOrganisationTypes.FirstOrDefault(x => x.Id == 1),
                    ServiceDeliveryUnitType = _serviceDeliveryUnitTypes.FirstOrDefault(x => x.Id == 1),
                    ResolverGroupType       = _resolverGroupTypes.FirstOrDefault(x => x.Id == 1)
                }
            });

            _serviceComponents.Add(new ServiceComponent
            {
                Id                     = 4,
                ComponentLevel         = 2,
                ComponentName          = "Component D",
                ServiceFunction        = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                ParentServiceComponent = _serviceComponents[1],
                Resolver               = new Resolver
                {
                    Id = 3,
                    ServiceDeliveryOrganisationType = _serviceDeliveryOrganisationTypes.FirstOrDefault(x => x.Id == 1),
                    ServiceDeliveryUnitType         = _serviceDeliveryUnitTypes.FirstOrDefault(x => x.Id == 2),
                    ResolverGroupType = _resolverGroupTypes.FirstOrDefault(x => x.Id == 3),
                }
            });

            _serviceComponents[1].ChildServiceComponents = new List <ServiceComponent>
            {
                _serviceComponents[2],
                _serviceComponents[3]
            };

            _serviceComponents.Add(new ServiceComponent
            {
                Id                = 5,
                ComponentLevel    = 1,
                ComponentName     = "Component E",
                ServiceActivities = "- Activity X\r\n- Activity Y",
                ServiceFunction   = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                Resolver          = new Resolver
                {
                    Id = 4,
                    ServiceDeliveryOrganisationType = _serviceDeliveryOrganisationTypes.FirstOrDefault(x => x.Id == 3),
                    ServiceDeliveryUnitType         = _serviceDeliveryUnitTypes.FirstOrDefault(x => x.Id == 2),
                    ResolverGroupType = _resolverGroupTypes.FirstOrDefault(x => x.Id == 4)
                }
            });

            _serviceComponents.Add(new ServiceComponent
            {
                Id              = 6,
                ComponentLevel  = 1,
                ComponentName   = "Component E",
                ServiceFunction = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
            });

            _serviceComponents.Add(new ServiceComponent
            {
                Id                     = 7,
                ComponentLevel         = 2,
                ComponentName          = "Component F",
                ServiceActivities      = "- Activity X",
                ServiceFunction        = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                ParentServiceComponent = _serviceComponents[5],
                Resolver               = new Resolver
                {
                    Id = 5,
                    ServiceDeliveryOrganisationType = _serviceDeliveryOrganisationTypes.FirstOrDefault(x => x.Id == 1),
                    ServiceDeliveryUnitType         = _serviceDeliveryUnitTypes.FirstOrDefault(x => x.Id == 2),
                    ResolverGroupType = _resolverGroupTypes.FirstOrDefault(x => x.Id == 3),
                }
            });

            _serviceComponents.Add(new ServiceComponent
            {
                Id                     = 8,
                ComponentLevel         = 2,
                ComponentName          = "Component G",
                ServiceActivities      = "- Activity Z",
                ServiceFunction        = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                ParentServiceComponent = _serviceComponents[5],
                Resolver               = new Resolver
                {
                    Id = 6,
                    ServiceDeliveryOrganisationType = _serviceDeliveryOrganisationTypes.FirstOrDefault(x => x.Id == 2),
                    ServiceDeliveryUnitType         = _serviceDeliveryUnitTypes.FirstOrDefault(x => x.Id == 2),
                    ResolverGroupType = _resolverGroupTypes.FirstOrDefault(x => x.Id == 4)
                }
            });

            _serviceComponents.Add(new ServiceComponent
            {
                Id                     = 9,
                ComponentLevel         = 2,
                ComponentName          = "Component H",
                ServiceActivities      = "- Activity A",
                ServiceFunction        = CreateServiceFunctionWithCustomer(2, "Robeco", 2),
                ParentServiceComponent = _serviceComponents[5],
                Resolver               = new Resolver
                {
                    Id = 7,
                    ServiceDeliveryOrganisationType = _serviceDeliveryOrganisationTypes.FirstOrDefault(x => x.Id == 1),
                    ServiceDeliveryUnitType         = _serviceDeliveryUnitTypes.FirstOrDefault(x => x.Id == 2),
                    ResolverGroupType = _resolverGroupTypes.FirstOrDefault(x => x.Id == 3)
                }
            });

            _serviceComponents[5].ChildServiceComponents = new List <ServiceComponent>
            {
                _serviceComponents[6],
                _serviceComponents[7],
                _serviceComponents[8]
            };

            #endregion

            _resolvers = new List <Resolver>();

            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _mockServiceDeskRepository      = MockRepositoryHelper.Create(_serviceDesks, (entity, id) => entity.Id == (int)id);
            _mockDeskInputTypeRepository    = MockRepositoryHelper.Create(_deskInputTypes, (entity, id) => entity.Id == (int)id);
            _mockResolverRepository         = MockRepositoryHelper.Create(_resolvers);
            _mockServiceComponentRepository = MockRepositoryHelper.Create(_serviceComponents, (entity, id) => entity.Id == (int)id);
            _mockUserIdentity = new Mock <IUserIdentity>();
            _mockUserIdentity.Setup(s => s.Name).Returns("*****@*****.**");

            _serviceDeskService      = new ServiceDeskService(_mockServiceDeskRepository.Object, _mockDeskInputTypeRepository.Object, _mockUnitOfWork.Object);
            _serviceComponentService = new ServiceComponentService(_mockServiceComponentRepository.Object, _mockResolverRepository.Object, _mockUnitOfWork.Object, _mockUserIdentity.Object);

            _diagramGenerator = new FujitsuServiceOrganisation(_serviceDeskService, _serviceComponentService);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 27
0
        public void Initialize()
        {
            var container = new ObjectBuilder(ObjectBuilderHelper.SetupObjectBuilder).GetContainer();

            Logger.SetLogWriter(new LogWriterFactory().Create(), false);

            var config  = ConfigurationSourceFactory.Create();
            var factory = new ExceptionPolicyFactory(config);

            var exceptionManager = factory.CreateManager();

            container.RegisterInstance(exceptionManager);

            ExceptionPolicy.SetExceptionManager(exceptionManager, false);

            _appContext = new AppContext
            {
                CurrentCustomer = new CurrentCustomerViewModel
                {
                    Id = CustomerId
                }
            };

            _mockAppUserContext = new Mock <IAppUserContext>();

            _mockAppUserContext.Setup(s => s.Current).Returns(_appContext);

            _mockUserManager = new Mock <IUserManager>();
            _mockUserManager.Setup(s => s.Name).Returns(UserName);
            _mockResponseManager = new Mock <IResponseManager>();

            _mockContextManager = new Mock <IContextManager>();
            _mockContextManager.Setup(s => s.UserManager).Returns(_mockUserManager.Object);
            _mockContextManager.Setup(s => s.ResponseManager).Returns(_mockResponseManager.Object);

            _mockAppUserContext = new Mock <IAppUserContext>();
            _mockAppUserContext.Setup(s => s.Current).Returns(_appContext);

            _mockUnitOfWork = new Mock <IUnitOfWork>();
            var dateTimeNow = DateTime.Now;

            _customers = new List <Customer>
            {
                new Customer
                {
                    Id                = 1,
                    CustomerName      = "3663",
                    CustomerNotes     = "Some 3663 Customer Notes.",
                    Active            = true,
                    Baseline          = false,
                    AssignedArchitect = UserNameOne,
                    ServiceDesks      = new List <ServiceDesk>
                    {
                        new ServiceDesk
                        {
                            DeskName       = "Desk 1",
                            DeskInputTypes = new List <DeskInputType>()
                        }
                    },
                    InsertedBy   = UserNameOne,
                    InsertedDate = dateTimeNow,
                    UpdatedBy    = UserNameOne,
                    UpdatedDate  = dateTimeNow
                },
                new Customer
                {
                    Id                = 2,
                    CustomerName      = "ING",
                    CustomerNotes     = "Some ING Customer Notes.",
                    Active            = true,
                    Baseline          = false,
                    AssignedArchitect = UserNameTwo,
                    InsertedBy        = UserNameTwo,
                    InsertedDate      = dateTimeNow,
                    UpdatedBy         = UserNameTwo,
                    UpdatedDate       = dateTimeNow
                },
                new Customer
                {
                    Id                = 3,
                    CustomerName      = "ING InActive",
                    CustomerNotes     = "Some ING Customer Notes.",
                    Active            = false,
                    Baseline          = false,
                    AssignedArchitect = UserNameOne,
                    InsertedBy        = UserNameOne,
                    InsertedDate      = dateTimeNow,
                    UpdatedBy         = UserNameOne,
                    UpdatedDate       = dateTimeNow
                },
                new Customer
                {
                    Id                = 4,
                    CustomerName      = "3663 MJJ",
                    CustomerNotes     = "Some 3663 MJJ Customer Notes.",
                    Active            = true,
                    Baseline          = false,
                    AssignedArchitect = UserNameOne,
                    InsertedBy        = UserNameOne,
                    InsertedDate      = dateTimeNow,
                    UpdatedBy         = UserNameOne,
                    UpdatedDate       = dateTimeNow
                },
            };

            _contributors = new List <Contributor>
            {
                new Contributor
                {
                    Id           = 1,
                    CustomerId   = 2,
                    UserId       = Guid.NewGuid().ToString(),
                    EmailAddress = UserNameOne,
                    Customer     = _customers[1]
                }
            };



            _mockCustomerRepository    = MockRepositoryHelper.Create(_customers, (entity, id) => entity.Id == (int)id);
            _mockContributorRepository = MockRepositoryHelper.Create(_contributors, (entity, id) => entity.Id == (int)id);

            _customerService = new CustomerService(
                _mockCustomerRepository.Object, _mockContributorRepository.Object, _mockUnitOfWork.Object);

            _contributorService = new ContributorService(_mockContributorRepository.Object, _mockUnitOfWork.Object);

            _mockContributorService = new Mock <IContributorService>();
            _mockContributorService.Setup(s => s.GetById(1)).Returns(_contributors[0]);
            _mockContributorService.Setup(s => s.GetCustomersContributors(2)).Returns(_contributors.Where(c => c.CustomerId == 2).AsQueryable());

            _controller = new CustomerController(_customerService,
                                                 _contributorService,
                                                 _mockContextManager.Object,
                                                 _mockAppUserContext.Object);

            _mockCustomerService = new Mock <ICustomerService>();
            var inits = new Dictionary <Type, Func <object, object> >
            {
                { typeof(ICollection <ServiceDesk>), (s) => null }
            };

            _mockCustomerService.Setup(s => s.GetById(1)).Returns(_customers[0].GetClone(inits));
            _mockCustomerService.Setup(s => s.GetById(2)).Returns(_customers[1].GetClone(inits));
            _mockCustomerService.Setup(s => s.Update(It.IsAny <Customer>()))
            .Callback <Customer>(c => _customerUpdated = c);


            _controllerWithMockedCustomerService = new CustomerController(_mockCustomerService.Object,
                                                                          _mockContributorService.Object,
                                                                          _mockContextManager.Object,
                                                                          _mockAppUserContext.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 28
0
        public void TestInitilize()
        {
            _domains = new List <DomainTypeRefData>
            {
                new DomainTypeRefData {
                    Id = 1, DomainName = "Domain A", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 2, DomainName = "Domain B", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 3, DomainName = "Domain C", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 4, DomainName = "Domain D", SortOrder = 5, Visible = true
                },
                new DomainTypeRefData {
                    Id = 5, DomainName = "3663 Domain E", SortOrder = 5, Visible = false
                },
                new DomainTypeRefData {
                    Id = 6, DomainName = "Robeco Domain F", SortOrder = 5, Visible = false
                }
            };

            _serviceDomains = new List <ServiceDomain>
            {
                UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                {
                    x.DomainType   = _domains.First(y => y.Id == 1);
                    x.DomainTypeId = 1;
                    x.ServiceDesk  = new ServiceDesk
                    {
                        Id         = 1,
                        CustomerId = CustomerId,
                        Customer   = UnitTestHelper.GenerateRandomData <Customer>(c =>
                        {
                            c.Id = CustomerId;
                            c.AssignedArchitect = UserNameTwo;
                            c.Contributors      = new List <Contributor>();
                        })
                    };
                }),
                UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                {
                    x.DomainType   = _domains.First(y => y.Id == 2);
                    x.DomainTypeId = 2;
                    x.ServiceDesk  = new ServiceDesk
                    {
                        Id         = 2,
                        CustomerId = 2,
                        Customer   = UnitTestHelper.GenerateRandomData <Customer>(c =>
                        {
                            c.Id = 2;
                            c.AssignedArchitect = UserNameTwo;
                            c.Contributors      = new List <Contributor>();
                        })
                    };
                }),
                UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                {
                    x.DomainType   = _domains.First(y => y.Id == 5);
                    x.DomainTypeId = 5;
                    x.ServiceDesk  = new ServiceDesk
                    {
                        Id         = 3,
                        CustomerId = 3,
                        Customer   = UnitTestHelper.GenerateRandomData <Customer>(c =>
                        {
                            c.Id = 3;
                            c.AssignedArchitect = UserNameOne;
                            c.Contributors      = new List <Contributor>
                            {
                                new Contributor
                                {
                                    Id           = 1,
                                    CustomerId   = 3,
                                    EmailAddress = UserNameThree
                                }
                            };
                        })
                    };
                }),
                UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                {
                    x.DomainType   = _domains.First(y => y.Id == 1);
                    x.DomainTypeId = 1;
                    x.ServiceDesk  = new ServiceDesk
                    {
                        Id         = 4,
                        CustomerId = 4,
                        Customer   = UnitTestHelper.GenerateRandomData <Customer>(c =>
                        {
                            c.Id = 4;
                            c.AssignedArchitect = UserNameTwo;
                            c.Contributors      = new List <Contributor>();
                        })
                    };
                })
            };

            _serviceDesks = new List <ServiceDesk>
            {
                new ServiceDesk
                {
                    CustomerId     = CustomerId,
                    ServiceDomains = new List <ServiceDomain>
                    {
                        UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                        {
                            x.DomainType   = _domains.First(y => y.Id == 1);
                            x.DomainTypeId = 1;
                        }),
                        UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                        {
                            x.DomainType = _domains.First(y => y.Id == 2);
                        }),
                        UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                        {
                            x.DomainType = _domains.First(y => y.Id == 5);
                        })
                    }
                },
                new ServiceDesk
                {
                    Customer       = UnitTestHelper.GenerateRandomData <Customer>(),
                    ServiceDomains = new List <ServiceDomain>
                    {
                        UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                        {
                            x.DomainType   = _domains.First(y => y.Id == 1);
                            x.DomainTypeId = 1;
                        }),
                        UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                        {
                            x.DomainType = _domains.First(y => y.Id == 2);
                        }),
                        UnitTestHelper.GenerateRandomData <ServiceDomain>(x =>
                        {
                            x.DomainType = _domains.First(y => y.Id == 6);
                        })
                    }
                }
            };

            _mockServiceDeskRepository = MockRepositoryHelper.Create(_serviceDesks);

            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _mockDomainTypeRefDataRepository = MockRepositoryHelper.Create(_domains);

            _mockServiceDomainRepository = MockRepositoryHelper.Create(_serviceDomains);

            _mockParameterService = new Mock <IParameterService>();

            _domainTypeRefDataService = new DomainTypeRefDataService(_mockDomainTypeRefDataRepository.Object,
                                                                     _mockServiceDeskRepository.Object,
                                                                     _mockServiceDomainRepository.Object,
                                                                     _mockParameterService.Object,
                                                                     _mockUnitOfWork.Object);

            Bootstrapper.SetupAutoMapper();
        }
Ejemplo n.º 29
0
        public void Intialize()
        {
            _sites = new List <Site>();

            _provisionedSiteCollections = new List <ProvisionedSiteCollection>
            {
                new ProvisionedSiteCollection
                {
                    Id           = 1,
                    Name         = "DCF-D10",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new ProvisionedSiteCollection
                {
                    Id           = 1,
                    Name         = "DCF-D11",
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
            };

            _provisionedSites = new List <ProvisionedSite>
            {
                new ProvisionedSite
                {
                    Id          = 1,
                    IsAllocated = false,
                    Url         = "https://mattjordan.sharepoint.com/sites/DCF-D10/97ce61fb-736f-4cbc-9c48-751120380da2",
                    ProvisionedSiteCollectionId = 1,
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new ProvisionedSite
                {
                    Id          = 2,
                    IsAllocated = true,
                    Url         = "https://mattjordan.sharepoint.com/sites/DCF-D10/fd240ec3-e872-490c-9d4c-ee1b4756d3d7",
                    ProvisionedSiteCollectionId = 1,
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new ProvisionedSite
                {
                    Id          = 3,
                    IsAllocated = false,
                    Url         = "https://mattjordan.sharepoint.com/sites/DCF-D10/ab2e5c1c-8cd2-4264-b60e-13f89f96810b",
                    ProvisionedSiteCollectionId = 1,
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new ProvisionedSite
                {
                    Id          = 4,
                    IsAllocated = false,
                    Url         = "https://mattjordan.sharepoint.com/sites/DCF-D10/bf0c92bd-2b08-46eb-9b41-19259c258807",
                    ProvisionedSiteCollectionId = 1,
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                },
                new ProvisionedSite
                {
                    Id          = 5,
                    IsAllocated = true,
                    Url         = "https://mattjordan.sharepoint.com/sites/DCF-D11/13b5319a-9ce5-4f25-90ab-45a4d15b91d1",
                    ProvisionedSiteCollectionId = 2,
                    InsertedBy   = UserName,
                    InsertedDate = _dateTime,
                    UpdatedBy    = UserName,
                    UpdatedDate  = _dateTime
                }
            };

            _mockUnitOfWork       = new Mock <IUnitOfWork>();
            _mockUserIdentity     = new Mock <IUserIdentity>();
            _mockParameterService = new Mock <IParameterService>();
            _mockContextService   = new Mock <IContextService>();
            _mockSiteService      = new Mock <IService <Site> >();
            _mockLibraryService   = new Mock <ILibraryService>();

            _mockLibraryRepository = new Mock <IRepository <Library> >();

            _mockSiteRepository = MockRepositoryHelper.Create(_sites, (entity, id) => entity.Id == (int)id);
            _mockProvisionedSiteCollectionRepository = MockRepositoryHelper.Create(_provisionedSiteCollections, (entity, id) => entity.Id == (int)id);
            _mockProvisionedSiteRepository           = MockRepositoryHelper.Create(_provisionedSites, (entity, id) => entity.Id == (int)id);
            _mockSiteRepository = new Mock <IRepository <Site> >();
            _pinService         = new PinService(_mockParameterService.Object, _mockContextService.Object, _mockSiteService.Object, _mockLibraryService.Object, _mockProvisionedSiteCollectionRepository.Object, _mockProvisionedSiteRepository.Object, _mockSiteRepository.Object, _mockLibraryRepository.Object, _mockUserIdentity.Object, _mockUnitOfWork.Object);
        }
Ejemplo n.º 30
0
        public void TestInitilize()
        {
            #region Desk Input Types

            _deskInputTypes = new List <DeskInputType>
            {
                new DeskInputType
                {
                    Id = 1,
                    InputTypeRefData =
                        new InputTypeRefData {
                        Id = 1, InputTypeNumber = 1, InputTypeName = "Incident", SortOrder = 5
                    },
                },
                new DeskInputType
                {
                    Id = 2,
                    InputTypeRefData =
                        new InputTypeRefData {
                        Id = 2, InputTypeNumber = 2, InputTypeName = "Event", SortOrder = 5
                    },
                },
                new DeskInputType
                {
                    Id = 3,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 3,
                        InputTypeNumber = 3,
                        InputTypeName   = "Authorized Request",
                        SortOrder       = 5
                    },
                },
                new DeskInputType
                {
                    Id = 4,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 4,
                        InputTypeNumber = 4,
                        InputTypeName   = "How do I.. Questions",
                        SortOrder       = 5
                    },
                },
                new DeskInputType
                {
                    Id = 5,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 5,
                        InputTypeNumber = 5,
                        InputTypeName   = "Authorized Standard Change",
                        SortOrder       = 5
                    },
                },
                new DeskInputType
                {
                    Id = 6,
                    InputTypeRefData =
                        new InputTypeRefData
                    {
                        Id = 6,
                        InputTypeNumber = 6,
                        InputTypeName   = "Authorized Non-Standard Change",
                        SortOrder       = 5
                    },
                },
            };

            #endregion

            #region Service Desks

            _serviceDesks = new List <ServiceDesk>
            {
                new ServiceDesk
                {
                    Id             = 1,
                    DeskName       = "Service Desk A With Inputs",
                    DeskInputTypes = new List <DeskInputType>
                    {
                        _deskInputTypes.FirstOrDefault(x => x.Id == 1),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 2),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 3),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 4),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 5),
                        _deskInputTypes.FirstOrDefault(x => x.Id == 6),
                    },
                    ServiceDomains = new List <ServiceDomain>(),
                    CustomerId     = 1,
                    Customer       = UnitTestHelper.GenerateRandomData <Customer>(x =>
                    {
                        x.Id = 1;
                    })
                },
                new ServiceDesk
                {
                    Id         = 2,
                    DeskName   = "Service Desk B With Domains",
                    CustomerId = 2,
                    Customer   = UnitTestHelper.GenerateRandomData <Customer>(x =>
                    {
                        x.Id = 2;
                    }),
                    ServiceDomains = new List <ServiceDomain>
                    {
                        new ServiceDomain
                        {
                            Id = 1,
                            AlternativeName = "Domain A",
                            DomainType      = new DomainTypeRefData
                            {
                                Id         = 1,
                                DomainName = "A Domain",
                                SortOrder  = 5,
                                Visible    = true
                            },
                            DiagramOrder     = 20,
                            ServiceFunctions = new List <ServiceFunction>
                            {
                                new ServiceFunction
                                {
                                    Id = 1,
                                    AlternativeName = "Function A",
                                    FunctionType    = new FunctionTypeRefData
                                    {
                                        Id           = 1,
                                        FunctionName = "A Function",
                                        SortOrder    = 5,
                                        Visible      = true,
                                    },
                                    ServiceComponents = new List <ServiceComponent>
                                    {
                                        new ServiceComponent
                                        {
                                            Id                = 1,
                                            ComponentLevel    = 1,
                                            ComponentName     = "Component A",
                                            ServiceActivities = "Email\r\nPhone",
                                            Resolver          = new Resolver
                                            {
                                                Id = 1,
                                                ResolverGroupType = UnitTestHelper.GenerateRandomData <ResolverGroupTypeRefData>()
                                            }
                                        }
                                    }
                                },
                                new ServiceFunction
                                {
                                    Id = 2,
                                    AlternativeName = "Function B",
                                    FunctionType    = new FunctionTypeRefData
                                    {
                                        Id           = 2,
                                        FunctionName = "B Function",
                                        SortOrder    = 5,
                                        Visible      = true,
                                    }
                                }
                            },
                        },
                        new ServiceDomain
                        {
                            Id         = 2,
                            DomainType = new DomainTypeRefData
                            {
                                Id         = 2,
                                DomainName = "Domain B",
                                SortOrder  = 5,
                                Visible    = true,
                            },
                            DiagramOrder = 15
                        },
                        new ServiceDomain
                        {
                            Id         = 3,
                            DomainType = new DomainTypeRefData
                            {
                                Id         = 3,
                                DomainName = "Domain C",
                                SortOrder  = 5,
                                Visible    = true,
                            },
                            DiagramOrder = 10
                        }
                    }
                },
                new ServiceDesk
                {
                    Id         = 3,
                    DeskName   = "Service Desk C With No Domains",
                    CustomerId = 2,
                    Customer   = UnitTestHelper.GenerateRandomData <Customer>(x =>
                    {
                        x.Id = 2;
                    }),
                    ServiceDomains = new List <ServiceDomain>()
                },
            };

            #endregion

            _mockUnitOfWork = new Mock <IUnitOfWork>();

            _mockServiceDeskRepository   = MockRepositoryHelper.Create(_serviceDesks, (entity, id) => entity.Id == (int)id);
            _mockDeskInputTypeRepository = MockRepositoryHelper.Create(_deskInputTypes, (entity, id) => entity.Id == (int)id);

            _serviceDeskService = new ServiceDeskService(_mockServiceDeskRepository.Object, _mockDeskInputTypeRepository.Object, _mockUnitOfWork.Object);
            _diagramGenerator   = new FujitsuDomains(_serviceDeskService);
            Bootstrapper.SetupAutoMapper();
        }