コード例 #1
0
        public async Task <CurrentTestScenario> GetCurrentTestScenarioById(string testScenarioId)
        {
            Guard.IsNullOrWhiteSpace(testScenarioId, nameof(testScenarioId));

            DocumentEntity <TestScenario> scenario = await _cosmosRepository.ReadAsync <TestScenario>(testScenarioId);

            if (scenario == null)
            {
                return(null);
            }

            CurrentTestScenario currentTestScenario = new CurrentTestScenario
            {
                LastUpdatedDate = scenario.UpdatedAt,
                Id                 = scenario.Id,
                Name               = scenario.Content.Name,
                Description        = scenario.Content.Current.Description,
                Author             = scenario.Content.Current.Author,
                Comment            = scenario.Content.Current.Comment,
                CurrentVersionDate = scenario.Content.Current.Date,
                PublishStatus      = scenario.Content.Current.PublishStatus,
                Gherkin            = scenario.Content.Current.Gherkin,
                Version            = scenario.Content.Current.Version,
                SpecificationId    = scenario.Content.SpecificationId,
            };

            return(currentTestScenario);
        }
コード例 #2
0
        public async Task <JobDefinition> GetJobDefinitionById(string jobDefinitionId)
        {
            Guard.IsNullOrWhiteSpace(jobDefinitionId, nameof(jobDefinitionId));

            DocumentEntity <JobDefinition> jobDefinition = await _cosmosRepository.ReadAsync <JobDefinition>(jobDefinitionId);

            if (jobDefinition != null)
            {
                return(jobDefinition.Content);
            }

            return(null);
        }
コード例 #3
0
        public async Task <Calculation> GetCalculationById(string calculationId)
        {
            Common.Models.DocumentEntity <Calculation> calculation = await _cosmosRepository.ReadAsync <Calculation>(calculationId);

            return(calculation?.Content);
        }