diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2017-09-06 10:36:28 -0600 |
---|---|---|
committer | Stephane Delcroix <stephane@delcroix.org> | 2017-10-18 17:28:44 +0200 |
commit | a5447531544a353dc9e98f31ada6637ec2ea28ce (patch) | |
tree | d7a8cc239246134d7e99d45c6f12336070cf5b5d /Xamarin.Forms.Controls | |
parent | 72fd2eef5fbe120159cfbf10316b55b85370d668 (diff) | |
download | xamarin-forms-a5447531544a353dc9e98f31ada6637ec2ea28ce.tar.gz xamarin-forms-a5447531544a353dc9e98f31ada6637ec2ea28ce.tar.bz2 xamarin-forms-a5447531544a353dc9e98f31ada6637ec2ea28ce.zip |
Allow duplicate issue numbers per tracker (#1127)
Diffstat (limited to 'Xamarin.Forms.Controls')
-rw-r--r-- | Xamarin.Forms.Controls/TestCases.cs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Xamarin.Forms.Controls/TestCases.cs b/Xamarin.Forms.Controls/TestCases.cs index cd49b08e..6989d64e 100644 --- a/Xamarin.Forms.Controls/TestCases.cs +++ b/Xamarin.Forms.Controls/TestCases.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; @@ -93,6 +94,8 @@ namespace Xamarin.Forms.Controls return page; } + + public TestCaseScreen () { AutomationId = "TestCasesIssueList"; @@ -102,28 +105,31 @@ namespace Xamarin.Forms.Controls var assembly = typeof (TestCases).GetTypeInfo ().Assembly; var issueModels = - from typeInfo in assembly.DefinedTypes.Select (o => o.AsType ().GetTypeInfo ()) + (from typeInfo in assembly.DefinedTypes.Select (o => o.AsType ().GetTypeInfo ()) where typeInfo.GetCustomAttribute<IssueAttribute> () != null - let attribute = (IssueAttribute)typeInfo.GetCustomAttribute<IssueAttribute> () + let attribute = typeInfo.GetCustomAttribute<IssueAttribute> () select new { IssueTracker = attribute.IssueTracker, IssueNumber = attribute.IssueNumber, - Name = attribute.IssueTracker.ToString ().Substring(0, 1) + attribute.IssueNumber.ToString (), + IssueTestNumber = attribute.IssueTestNumber, + Name = attribute.DisplayName, Description = attribute.Description, Action = ActivatePageAndNavigate (attribute, typeInfo.AsType ()) - }; + }).ToList(); var root = new TableRoot (); var section = new TableSection ("Bug Repro"); root.Add (section); var duplicates = new HashSet<string> (); - issueModels.ForEach (im => { + issueModels.ForEach (im => + { if (duplicates.Contains (im.Name) && !IsExempt (im.Name)) { - throw new NotSupportedException ("Please provide unique tracker + issue number combo: " + im.IssueTracker.ToString () + im.IssueNumber.ToString ()); - } else { - duplicates.Add (im.Name); + throw new NotSupportedException ("Please provide unique tracker + issue number combo: " + + im.IssueTracker.ToString () + im.IssueNumber.ToString () + im.IssueTestNumber.ToString()); } + + duplicates.Add (im.Name); }); var githubIssueCells = |