예제 #1
0
 /// <summary>
 /// Конструктор <see cref="TaskCreateService"/>.
 /// </summary>
 /// <param name="jira_api_service">Сервис для работы с JIRA.</param>
 /// <param name="ldap_service">Сервис Ldap.</param>
 /// <param name="task_repository">Репозиторий типов задач.</param>
 /// <param name="workflow_repository">Репозиторий для работы с процессами <see cref="Workflow"/>.</param>
 /// <param name="role2_workflow_repository">Репозиторий для работы со связями роли и процесса <see cref="Role2Workflow"/>.</param>
 /// <param name="product_repository">Репозиторий для работы с товаром <see cref="Product"/>.</param>
 /// <param name="exploration_repository">Репозиторий для работы с исследованиями <see cref="Exploration"/>.</param>
 /// <param name="perimeter_repository">Репозиторий для работы с периметром <see cref="Perimeter"/>.</param>
 public TaskCreateService(
     IJiraApiService jira_api_service,
     ILdapService ldap_service,
     IBaseConfigurationRepository <Task> task_repository,
     IBaseConfigurationRepository <Workflow> workflow_repository,
     IBaseConfigurationRepository <Role2Workflow> role2_workflow_repository,
     IBaseConfigurationRepository <Product> product_repository,
     IBaseConfigurationRepository <Exploration> exploration_repository,
     IBaseConfigurationRepository <Perimeter> perimeter_repository)
 {
     _jiraApiService          = jira_api_service;
     _ldapService             = ldap_service;
     _taskRepository          = task_repository;
     _workflowRepository      = workflow_repository;
     _role2WorkflowRepository = role2_workflow_repository;
     _productRepository       = product_repository;
     _explorationRepository   = exploration_repository;
     _perimeterRepository     = perimeter_repository;
 }
예제 #2
0
        public void SetUp()
        {
            _jiraApiService          = Substitute.For <IJiraApiService>();
            _ldapService             = Substitute.For <ILdapService>();
            _workflowRepository      = Substitute.For <IBaseConfigurationRepository <Workflow> >();
            _taskRepository          = Substitute.For <IBaseConfigurationRepository <Task> >();
            _role2WorkflowRepository = Substitute.For <IBaseConfigurationRepository <Role2Workflow> >();
            _productRepository       = Substitute.For <IBaseConfigurationRepository <Product> >();
            _perimeterRepository     = Substitute.For <IBaseConfigurationRepository <Perimeter> >();
            _explorationRepository   = Substitute.For <IBaseConfigurationRepository <Exploration> >();

            _workflowRepository.GetAll().Returns(new List <Workflow>
            {
                new Workflow
                {
                    Id              = WORKFLOW_ID,
                    ProductId       = PRODUCT_ID,
                    TaskCode        = TaskCode.Explore.ToString(),
                    PerimeterId     = PERIMETER_ID,
                    ExplorationId   = EXPLORATION_ID,
                    CommitRequired  = true,
                    CommentTemplate = "template",
                    BusinessProcess = "619"
                }
            });

            _role2WorkflowRepository.GetAll().Returns(new List <Role2Workflow>
            {
                new Role2Workflow
                {
                    WorkflowId = WORKFLOW_ID,
                    Role       = ROLE
                }
            });

            _productRepository.GetAll().Returns(new List <Product>
            {
                new Product
                {
                    Id   = PRODUCT_ID,
                    Code = PRODUCT_CODE
                }
            });

            _explorationRepository.GetAll().Returns(new List <Exploration>
            {
                new Exploration
                {
                    Id   = EXPLORATION_ID,
                    Name = EXPLORATION_NAME
                }
            });

            _taskRepository.GetAll().Returns(new List <Task>
            {
                new Task
                {
                    Code = TaskCode.Explore.ToString(),
                    Name = EXPLORATION_NAME
                }
            });

            _perimeterRepository.GetAll().Returns(new List <Perimeter>
            {
                new Perimeter
                {
                    Key   = PERIMETER_ID,
                    Value = PERIMETER_VALUE
                }
            });

            _taskCreateService = new TaskCreateService
                                 (
                _jiraApiService,
                _ldapService,
                _taskRepository,
                _workflowRepository,
                _role2WorkflowRepository,
                _productRepository,
                _explorationRepository,
                _perimeterRepository
                                 );
        }