コード例 #1
0
        public void DeleteCase_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id        = 1,
                Frequency = TaskFrequencyNames.OneTime,
                Handler   = TaskHandlerNames.OperationsHandler,
                Name      = TaskNames.DeleteCase
            };

            _mockParameterService.Setup(s => s.GetParameterByNameAndCache <int>(ParameterNames.DigitialCaseFileRetentionPeriodInWeeks)).Returns(1300);

            _operationTaskProcessor.Execute(task);
        }
コード例 #2
0
        public void HelloWorldPin_Execute_ValidTaskExecutesTask()
        {
            var task = new Task
            {
                Id        = 1,
                Frequency = TaskFrequencyNames.OneTime,
                Handler   = TaskHandlerNames.OperationsHandler,
                Name      = TaskNames.HelloWorldPin,
                Pin       = 12345,
            };

            _operationTaskProcessor.Execute(task);

            _mockPinService.Verify(v => v.HelloWorldPin(It.IsAny <Task>()), Times.Once);
        }
コード例 #3
0
        public void UpdatePinWithDictionaryValues_Execute_ValidTaskExecutesTask()
        {
            var task = new Task
            {
                Id         = 1,
                Frequency  = TaskFrequencyNames.OneTime,
                Handler    = TaskHandlerNames.OperationsHandler,
                Name       = TaskNames.UpdatePinWithDictionaryValues,
                Pin        = 12345,
                Dictionary = ValidDictionaryXml
            };

            _operationTaskProcessor.Execute(task);

            _mockPinService.Verify(v => v.UpdatePinWithDictionaryValues(It.IsAny <Task>()), Times.Once);
        }
コード例 #4
0
ファイル: CloseCaseTests.cs プロジェクト: MattyJ/AFC-Solution
        public void CloseCase_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id         = 1,
                Frequency  = TaskFrequencyNames.OneTime,
                Handler    = TaskHandlerNames.OperationsHandler,
                Name       = TaskNames.CloseCase,
                Pin        = 12346,
                ProjectId  = 12345,
                CaseId     = 12345,
                Dictionary = ValidDictionaryXml
            };

            _mockTaskService.Setup(s => s.PendingMergeFromPinOperation(It.IsAny <int>(), It.IsAny <DateTime>())).Returns(false);

            _operationTaskProcessor.Execute(task);
        }
コード例 #5
0
        public void AllocateCase_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id         = 1,
                Frequency  = TaskFrequencyNames.OneTime,
                Handler    = TaskHandlerNames.OperationsHandler,
                Name       = TaskNames.AllocateCase,
                Pin        = 12346,
                ProjectId  = 12345,
                CaseId     = 12346,
                CaseTitle  = "Bayswater Family Care [Open] Current open episode",
                IsPrimary  = true,
                Dictionary = ValidDictionaryXml
            };

            _mockTaskService.Setup(s => s.PendingMergeFromPinOperation(It.IsAny <int>(), It.IsAny <DateTime>())).Returns(false);

            _operationTaskProcessor.Execute(task);
        }
コード例 #6
0
        public void RestrictUser_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id        = 1,
                Frequency = TaskFrequencyNames.OneTime,
                Handler   = TaskHandlerNames.OperationsHandler,
                Name      = TaskNames.RestrictUser,
                Pin       = 12346
            };

            _mockTaskService.Setup(s => s.PendingMergeFromPinOperation(It.IsAny <int>(), It.IsAny <DateTime>())).Returns(false);

            _operationTaskProcessor.Execute(task);
        }
コード例 #7
0
        public void UpdateCaseWithDictionaryValues_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id         = 1,
                Frequency  = TaskFrequencyNames.OneTime,
                Handler    = TaskHandlerNames.OperationsHandler,
                Name       = TaskNames.UpdateCaseWithDictionaryValues,
                Pin        = 12346,
                CaseId     = 12345,
                Dictionary = ValidDictionaryXml
            };

            _operationTaskProcessor.Execute(task);
        }
コード例 #8
0
        public void AllocatePin_Execute_ValidTaskWithUnallocatedSitesAvailablePassesPreLimChecksAndExecutesTask()
        {
            _mockProvisioningService.Setup(s => s.GetNumberOfUnallocatedSites()).Returns(10);
            _mockTaskService.Setup(s => s.PendingAllocatePinOperation(It.IsAny <int>(), It.IsAny <DateTime>())).Returns(false);

            var task = new Task
            {
                Id         = 1,
                Frequency  = TaskFrequencyNames.OneTime,
                Handler    = TaskHandlerNames.OperationsHandler,
                Name       = TaskNames.AllocatePin,
                Pin        = 12345,
                SiteTitle  = "Example PIN Site",
                Dictionary = ValidDictionaryXml
            };

            _operationTaskProcessor.Execute(task);

            _mockPinService.Verify(v => v.AllocatePin(It.IsAny <Task>()), Times.Once);
        }
コード例 #9
0
        public void ArchiveCase_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id        = 1,
                Frequency = TaskFrequencyNames.OneTime,
                Handler   = TaskHandlerNames.OperationsHandler,
                Name      = TaskNames.ArchiveCase,
                Pin       = 12346,
                CaseId    = 12345,
                CaseTitle = "The New Case Title"
            };

            _operationTaskProcessor.Execute(task);
        }
コード例 #10
0
        public void ChangePrimaryProject_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id               = 1,
                Frequency        = TaskFrequencyNames.OneTime,
                Handler          = TaskHandlerNames.OperationsHandler,
                Name             = TaskNames.ChangePrimaryProject,
                Pin              = 12346,
                CurrentProjectId = 1,
                NewProjectId     = 2,
                Dictionary       = ValidDictionaryXml
            };

            _operationTaskProcessor.Execute(task);
        }
コード例 #11
0
        public void UpdateServiceUserTitle_Execute_ValidTaskWithUnallocatedSitesAvailablePassesPreLimChecksAndExecutesTask()
        {
            _mockTaskService.Setup(s => s.PendingMergeFromPinOperation(It.IsAny <int>(), It.IsAny <DateTime>())).Returns(false);

            var task = new Task
            {
                Id        = 1,
                Frequency = TaskFrequencyNames.OneTime,
                Handler   = TaskHandlerNames.OperationsHandler,
                Name      = TaskNames.UpdateServiceUserTitle,
                Pin       = 12345,
                SiteTitle = "Example PIN Site"
            };

            _operationTaskProcessor.Execute(task);

            _mockPinService.Verify(v => v.UpdatePinTitle(It.IsAny <Task>()), Times.Once);
        }
コード例 #12
0
        public void MergePin_Execute_ValidTaskPassesPreLimChecksAndExecutesTask()
        {
            var task = new Task
            {
                Id        = 1,
                Frequency = TaskFrequencyNames.OneTime,
                Handler   = TaskHandlerNames.OperationsHandler,
                Name      = TaskNames.MergePin,
                FromPin   = 123456,
                ToPin     = 654321
            };

            _operationTaskProcessor.Execute(task);

            _mockPinService.Verify(v => v.MergePin(It.IsAny <Task>()), Times.Once);
        }
コード例 #13
0
        public void DeletePin_Execute_ValidTaskPassesPreLimChecksAndExecutesTask()
        {
            _mockTaskService.Setup(s => s.PendingMergeToPinOperation(It.IsAny <int>(), It.IsAny <DateTime>())).Returns(false);
            _mockTaskService.Setup(s => s.PendingMergeFromPinOperation(It.IsAny <int>(), It.IsAny <DateTime>())).Returns(false);

            var task = new Task
            {
                Id        = 1,
                Frequency = TaskFrequencyNames.OneTime,
                Handler   = TaskHandlerNames.OperationsHandler,
                Name      = TaskNames.DeletePin,
                Pin       = 12346
            };

            _operationTaskProcessor.Execute(task);

            _mockPinService.Verify(v => v.DeletePin(It.IsAny <Task>()), Times.Once);
        }
コード例 #14
0
        public void UpdateCaseTitleByProject_Execute_ExecutesTask()
        {
            var task = new Task
            {
                Id          = 1,
                Frequency   = TaskFrequencyNames.OneTime,
                Handler     = TaskHandlerNames.OperationsHandler,
                Name        = TaskNames.UpdateCaseTitleByProject,
                ProjectId   = 12345,
                ProjectName = "Bayswater Family Care [Open] Current open episode",
                Dictionary  = ValidDictionaryXml
            };

            _operationTaskProcessor.Execute(task);
        }