예제 #1
0
        private async Task <int> CreateStandardTagAsync(
            int stepId,
            bool startPreservation)
        {
            var newReqDefId = await CreateRequirementDefinitionAsync(UserType.LibraryAdmin, TestFactory.PlantWithAccess);

            var tagNo = Guid.NewGuid().ToString();

            MockMainApiDataForTag(tagNo);

            var newTagIds = await TagsControllerTestsHelper.CreateStandardTagAsync(
                UserType.Planner,
                TestFactory.PlantWithAccess,
                TestFactory.ProjectWithAccess,
                new [] { tagNo },
                new List <TagRequirementDto>
            {
                new TagRequirementDto
                {
                    IntervalWeeks           = 4,
                    RequirementDefinitionId = newReqDefId
                }
            },
                stepId,
                null,
                null);

            if (startPreservation)
            {
                await TagsControllerTestsHelper.StartPreservationAsync(UserType.Planner, TestFactory.PlantWithAccess, newTagIds);
            }
            return(newTagIds.Single());
        }
예제 #2
0
        private async Task <int> CreateAreaTagAsync(
            AreaTagType areaTagType,
            int stepId,
            string purchaseOrderCalloffCode,
            bool startPreservation)
        {
            var newReqDefId = await CreateRequirementDefinitionAsync(UserType.LibraryAdmin, TestFactory.PlantWithAccess);

            var newTagId = await TagsControllerTestsHelper.CreateAreaTagAsync(
                UserType.Planner, TestFactory.PlantWithAccess,
                TestFactory.ProjectWithAccess,
                areaTagType,
                KnownDisciplineCode,
                KnownAreaCode,
                $"Title_{Guid.NewGuid()}",
                new List <TagRequirementDto>
            {
                new TagRequirementDto
                {
                    IntervalWeeks           = 4,
                    RequirementDefinitionId = newReqDefId
                }
            },
                stepId,
                $"Desc_{Guid.NewGuid()}",
                null,
                null,
                purchaseOrderCalloffCode);

            if (startPreservation)
            {
                await TagsControllerTestsHelper.StartPreservationAsync(UserType.Planner, TestFactory.PlantWithAccess, new List <int> {
                    newTagId
                });
            }
            return(newTagId);
        }