public async Task UpdateCategoryWithHistoryCheck()
        {
            var         projectId               = TestSettings.TestProjectId;
            var         testCategory            = "EXTRA CATEGORY";
            string      originalCategoryViewKey = null;
            Func <Task> updateCategory          = async() => {
                originalCategoryViewKey = await UpdateProjectCategory(projectId, testCategory);
            };

            // Test procedure:
            // 1. Update config to add the category
            // - at the midpoint, update the project to use the test category
            // - config then resets - but category is in use so is only hidden
            await ConfigurationTestUtils.TestCollectionLabel(ProjectPropertyConstants.category, testCategory, midpointTest : updateCategory);

            // 2. Update the project to not use the label
            var project = await ProjectTestData.LoadAsync(projectId);

            project.ProjectUpdate.category = originalCategoryViewKey;
            await project.UpdateAsync();

            // 3. Check the option has disappeared.
            await project.LoadAsync();

            var categoryItem = project.DTO.Options.CategoryItems.SingleOrDefault(i => i.Display == testCategory);

            Assert.IsNull(categoryItem);

            // 4. Do a no-change update on config (hidden option should be removed - but no way to verify!)
            var config = await ConfigTestData.LoadAsync(TestSettings.TestPortfolio);

            await config.UpdateAsync();
        }
Example #2
0
        public async Task UpdateProjectOptions()
        {
            await ConfigurationTestUtils.TestCollectionLabel(ProjectPropertyConstants.project_size, ProjectSize_TestValue);

            await ConfigurationTestUtils.TestCollectionLabel(ProjectPropertyConstants.budgettype, "EXTRA BUDGET TYPE");

            await ConfigurationTestUtils.TestCollectionLabel(ProjectPropertyConstants.onhold, "EXTRA STATUS");

            await ConfigurationTestUtils.TestCollectionLabel(ProjectPropertyConstants.risk_rating, "EXTRA RISK");

            await ConfigurationTestUtils.TestCollectionLabel(ProjectPropertyConstants.phase, "Backlog, Phase1, Phase2, Phase3, Phase4, Phase5", addToCurrent : false);

            // TODO: add rest of collections
        }