コード例 #1
0
        /// <summary>
        /// Validates content - downloads files
        /// </summary>
        public string Validate(PlasmaDownloader.PlasmaDownloader downloader, bool waitForDownload)
        {
            if (!Benchmarks.Any())
            {
                return
                    ("No benchmarks selected - please add benchmarks (mutators/games) into Gaqmes or Benchmarks/games folder - in the folder.sdd format");
            }
            if (!TestCases.Any())
            {
                return("Please add test case runs using add button here");
            }

            foreach (var bench in Benchmarks)
            {
                var ret = bench.Validate(downloader, waitForDownload);
                if (ret != null)
                {
                    return(ret);
                }
            }

            foreach (var run in TestCases)
            {
                var ret = run.Validate(downloader, waitForDownload);
                if (ret != null)
                {
                    return(ret);
                }
            }
            return("OK");
        }
コード例 #2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            string newTestName;

            for (int testId = 1; ; ++testId)
            {
                newTestName = "case" + testId;
                if (!TestCases.Any(t => StringComparer.CurrentCultureIgnoreCase.Equals(newTestName, t.Name)))
                {
                    break;
                }
            }

            var newTestCase = new TestCase
            {
                Name          = newTestName,
                Input         = "",
                Output        = "",
                IsEnabled     = true,
                OutputIsKnown = true,
            };

            TestCases.Add(newTestCase);
            lstTestCases.SelectedItem = newTestCase;
        }
コード例 #3
0
 public bool IsValid()
 {
     return(!string.IsNullOrEmpty(Name) &&
            !string.IsNullOrEmpty(Title) &&
            !string.IsNullOrEmpty(Description) &&
            Uri.IsWellFormedUriString(Url.ToString(), UriKind.RelativeOrAbsolute) &&
            Uri.IsWellFormedUriString(ParentStoryUrl.ToString(), UriKind.RelativeOrAbsolute) &&
            KeyIdentifiers != null &&
            KeyIdentifiers.Any() ? KeyIdentifiers.All(s => s.IsValid()) : true &&
            TestCases != null &&
            TestCases.Any() ? TestCases.All(s => s.IsValid()) : true &&
            Checkups != null &&
            Checkups.Any() ? Checkups.All(s => s.IsValid()) : true &&
            Attachments != null &&
            Attachments.Any() ? Attachments.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true &&
            Queries != null &&
            Queries.Any() ? Queries.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true &&
            Scripts != null &&
            Scripts.Any() ? Scripts.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true &&
            SubTasks.Any() ? SubTasks.All(s => s.IsValid()) : true);
 }
コード例 #4
0
 private bool CanExecuteRun()
 => !IsBusy && TestCases.Any();
コード例 #5
0
        private FlowDocument BuildDocument()
        {
            var doc = new FlowDocument();

            doc.LineStackingStrategy = System.Windows.LineStackingStrategy.BlockLineHeight;
            doc.LineHeight           = 12;
            doc.Blocks.Add(new Paragraph(new Bold(new Run("Summary"))));
            doc.Blocks.Add(new Paragraph(new Run(" " + Title)));
            doc.Blocks.Add(new Paragraph(new Bold(new Run("Description"))));
            doc.Blocks.Add(new Paragraph(new Run(" " + Description)));

            doc.Blocks.Add(new Paragraph(new Bold(new Run("Url"))));
            var url = new Hyperlink(new Run(Url.ToString()));

            doc.Blocks.Add(new Paragraph(url));
            doc.Blocks.Add(new Paragraph(new Bold(new Run("Parent Story"))));
            var parentUrl = new Hyperlink(new Run(ParentStoryUrl.ToString()));

            parentUrl.NavigateUri = ParentStoryUrl;
            doc.Blocks.Add(new Paragraph(parentUrl));

            doc.Blocks.Add(new Paragraph(new Italic(new Run("Status: " + Status.ToString()))));

            doc.Blocks.Add(new Paragraph(new Italic(new Run("Date Started: " + DateStarted.Value.ToString("yyyy-MM-dd hh:mm:ss")))));
            if (DateEnded.HasValue && DateEnded.Value != DateTime.MinValue)
            {
                doc.Blocks.Add(new Paragraph(new Italic(new Run("Date Ended: " + DateEnded.Value.ToString("yyyy-MM-dd hh:mm:ss")))));
            }

            if (Attachments.Any())
            {
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Attachments"))));
                foreach (var item in Attachments)
                {
                    var itemUri = new Uri(item.Value);
                    var itemUrl = new Hyperlink(new Run(item.Value));
                    doc.Blocks.Add(new Paragraph(itemUrl));
                }
            }

            if (AcceptanceCriteria.Any())
            {
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Acceptance Criteria"))));
                foreach (var item in AcceptanceCriteria)
                {
                    doc.Blocks.Add(new Paragraph(new Run(" + " + item.Value)));
                }
            }

            if (DeveloperCriteria.Any())
            {
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Development Criteria"))));
                foreach (var item in DeveloperCriteria)
                {
                    doc.Blocks.Add(new Paragraph(new Run(" + " + item.Value)));
                }
            }

            var i = 0;
            var j = 0;

            if (KeyIdentifiers.Any())
            {
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Key Identifiers"))));
                foreach (var item in KeyIdentifiers)
                {
                    doc.Blocks.Add(new Paragraph(new Run(" " + (++i).ToString() + ". " + item.Description)));

                    if (item.Questions.Any())
                    {
                        j = 0;
                        doc.Blocks.Add(new Paragraph(new Italic(new Run(" Questions"))));
                        foreach (var q in item.Questions)
                        {
                            doc.Blocks.Add(new Paragraph(new Run("   " + (++j).ToString() + ".Q. " + q.Ask)));
                            doc.Blocks.Add(new Paragraph(new Run("     A. " + q.Answer)));
                        }
                    }
                }
            }

            if (Issues.Any())
            {
                i = 0;
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Issues"))));
                foreach (var item in Issues)
                {
                    doc.Blocks.Add(new Paragraph(new Run(" " + (++i).ToString() + ". " + item.Description)));
                    doc.Blocks.Add(new Paragraph(new Italic(new Run("  Is Open: " + item.IsOpen.ToString()))));
                }
            }

            if (Queries.Any())
            {
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Queries"))));
                foreach (var item in Queries)
                {
                    var itemUri = new Uri(item.Value);
                    var itemUrl = new Hyperlink(new Run(item.Value));
                    doc.Blocks.Add(new Paragraph(itemUrl));
                }
            }

            if (Scripts.Any())
            {
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Scripts"))));
                foreach (var item in Scripts)
                {
                    var itemUri = new Uri(item.Value);
                    var itemUrl = new Hyperlink(new Run(item.Value));
                    doc.Blocks.Add(new Paragraph(itemUrl));
                }
            }

            if (TestCases.Any())
            {
                i = 0;
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Test Cases"))));
                foreach (var item in TestCases)
                {
                    doc.Blocks.Add(new Paragraph(new Run(" " + (++i).ToString() + ". " + item.Description)));
                    doc.Blocks.Add(new Paragraph(new Italic(new Run("  Status: " + item.Status.ToString()))));

                    if (item.Steps.Any())
                    {
                        j = 0;
                        doc.Blocks.Add(new Paragraph(new Italic(new Run(" Steps"))));
                        foreach (var q in item.Steps)
                        {
                            doc.Blocks.Add(new Paragraph(new Run("   " + (++j).ToString() + ". " + q.Value)));
                        }
                    }
                }
            }

            if (Checkups.Any())
            {
                i = 0;
                doc.Blocks.Add(new Paragraph(new Bold(new Run("Checkups"))));
                foreach (var item in Checkups)
                {
                    doc.Blocks.Add(new Paragraph(new Run(" " + (++i).ToString() + ". " + item.Description)));
                    doc.Blocks.Add(new Paragraph(new Italic(new Run("  Applied: " + item.Applied.ToString()))));
                }
            }

            if (SubTasks.Any())
            {
                i = 0;
                doc.Blocks.Add(new Paragraph(new Bold(new Run("SubTasks"))));
                foreach (var item in SubTasks)
                {
                    doc.Blocks.Add(new Paragraph(new Run(" " + (++i).ToString() + ". " + item.Title)));
                    doc.Blocks.Add(new Paragraph(new Italic(new Run("  Status: " + item.Status))));
                }
            }

            return(doc);
        }