Esempio n. 1
0
 public DocumentStructure(DocumentStructureType type_, int min_ = 1, int max_ = 100, float chance_ = 100, float headingChance_ = 0.0f)
 {
     type          = type_;
     min           = min_;
     max           = max_;
     chance        = chance_;
     headingChance = headingChance_;
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestSpecificationReportModel"/> class for the console extension
 /// </summary>
 /// <param name="syncServiceDocumentModel">The <see cref="ISyncServiceModel"/> to obtain document settings.</param>
 /// <param name="testAdapter"><see cref="ITfsTestAdapter"/> to examine test information.</param>
 /// <param name="sort"></param>
 /// <param name="testReportingProgressCancellationService">The progess cancellation service used to check at certain points if a cancellation has been triggered and further steps should be skipped.</param>
 /// <param name="plan">The selected <see cref="ITfsTestPlan"/> used for the report generation.</param>
 /// <param name="suite">The selected <see cref="ITfsTestSuite"/> used for the report generation.</param>
 /// <param name="documentStructure">The information if a document structure should be created.</param>
 /// <param name="skipLevels">The level count to ignore generation.</param>
 /// <param name="structureType"></param>
 public TestSpecificationReportModel(ISyncServiceDocumentModel syncServiceDocumentModel, ITfsTestAdapter testAdapter, ITfsTestPlan plan, ITfsTestSuite suite, bool documentStructure, int skipLevels, DocumentStructureType structureType, TestCaseSortType sort, ITestReportingProgressCancellationService testReportingProgressCancellationService)
     : base(syncServiceDocumentModel, testAdapter, testReportingProgressCancellationService)
 {
     SelectedTestPlan        = plan;
     SelectedTestSuite       = suite;
     CreateDocumentStructure = documentStructure;
     SkipLevels = skipLevels;
     SelectedDocumentStructureType = structureType;
     SelectedTestCaseSortType      = sort;
     CreateReportCommand           = new ViewCommand(ExecuteCreateReportCommand, CanExecuteCreateReportCommand);
     WordDocument = syncServiceDocumentModel.WordDocument as Document;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestCaseHelper"/> class.
 /// </summary>
 /// <param name="testCases">Collection of test cases - data source.</param>
 /// <param name="pathType">Path of test cases to use by all operations in this class.
 /// (Supported is <see cref="DocumentStructureType.IterationPath"/> and <see cref="DocumentStructureType.AreaPath"/>.)</param>
 public TestCaseHelper(IEnumerable <ITfsTestCaseDetail> testCases, DocumentStructureType pathType)
 {
     if (testCases == null)
     {
         throw new ArgumentNullException("testCases");
     }
     CheckTestResults  = false;
     TestAdapter       = null;
     TestConfiguration = null;
     TestCases         = testCases;
     PathType          = pathType;
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestCaseHelper"/> class.
 /// </summary>
 /// <param name="testAdapter">Adapter to obtain information.</param>
 /// <param name="testPlan"><see cref="ITfsTestPlan"/> is the source of test cases to write out.</param>
 /// <param name="testConfiguration">Configuration filter used to determine test results for test case. <c>null</c> - all configurations.</param>
 /// <param name="serverBuild">Build filter used to determine test result for test case.</param>
 /// <param name="testCases">Collection of test cases - data source.</param>
 /// <param name="pathType">Path of test cases to use by all operations in this class.
 /// (Supported is <see cref="DocumentStructureType.IterationPath"/> and <see cref="DocumentStructureType.AreaPath"/>.)</param>
 public TestCaseHelper(ITfsTestAdapter testAdapter, ITfsTestPlan testPlan, ITfsTestConfiguration testConfiguration, ITfsServerBuild serverBuild,
                       IEnumerable <ITfsTestCaseDetail> testCases, DocumentStructureType pathType)
 {
     if (testAdapter == null)
     {
         throw new ArgumentNullException("testAdapter");
     }
     if (testCases == null)
     {
         throw new ArgumentNullException("testCases");
     }
     CheckTestResults  = true;
     TestAdapter       = testAdapter;
     TestPlan          = testPlan;
     TestConfiguration = testConfiguration;
     ServerBuild       = serverBuild;
     TestCases         = testCases;
     PathType          = pathType;
 }
Esempio n. 5
0
        /// <summary>
        /// The method extracts all paths (Area or Iteration) from given test cases.
        /// </summary>
        /// <param name="pathType">Path to extract - AreaPath or IterationPath.</param>
        /// <returns>All extracted paths from given <see cref="ITfsTestCaseDetail"/>.</returns>
        private IEnumerable <string> ExtractAllPaths(DocumentStructureType pathType)
        {
            if (pathType != DocumentStructureType.AreaPath && pathType != DocumentStructureType.IterationPath)
            {
                return(null);
            }
            var paths = new List <string>();

            foreach (var testCase in TestCases)
            {
                if (pathType == DocumentStructureType.AreaPath)
                {
                    // Valid path? Already inserted?
                    if (string.IsNullOrEmpty(testCase.AreaPath) || paths.Contains(testCase.AreaPath))
                    {
                        continue;
                    }
                    // Contains test results?
                    if (CheckTestResults && !TestAdapter.TestResultExists(TestPlan, null, testCase, TestConfiguration, ServerBuild))
                    {
                        continue;
                    }
                    // Add
                    paths.Add(testCase.AreaPath);
                }
                else if (pathType == DocumentStructureType.IterationPath)
                {
                    // Valid path? Already inserted?
                    if (string.IsNullOrEmpty(testCase.IterationPath) || paths.Contains(testCase.IterationPath))
                    {
                        continue;
                    }
                    // Contains test results?
                    if (CheckTestResults && !TestAdapter.TestResultExists(TestPlan, null, testCase, TestConfiguration, ServerBuild))
                    {
                        continue;
                    }
                    // Add
                    paths.Add(testCase.IterationPath);
                }
            }
            return(paths);
        }
Esempio n. 6
0
 public static Unigram Structure(DocumentStructureType type_, int min_ = 1, int max_ = 100, float chance_ = 100, float headingChance_ = 100)
 {
     return(new Unigram(new DocumentStructure(type_, min_, max_, chance_, headingChance_)));
 }