Skip to content

Commit

Permalink
gitignore hiden TestResultProvider fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ekhatko committed Mar 18, 2014
1 parent 6214436 commit 70715eb
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ AppPackages/
[Oo]bj
sql
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
Expand Down
77 changes: 77 additions & 0 deletions TestResultProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace tfs_cli
{
class TestResultProvider : ITestResultProvider
{
private string _name;
private string _outcome;
private string _comment;
private string _attachment;
private string _failure_type;
private string _error_message;
private string _duration;

private IList<string> possibleOutcomes = new List<string>()
{
"Aborted",
"Blocked",
"Error",
"Failed",
"Inconclusive",
"None",
"NotApplicable",
"NotExecuted",
"Passed",
"Paused",
"Timeout",
"Unspecified",
"Warning"
};

private IList<string> possibleFailureTypes = new List<string>()
{
"KnowIssue",
"NewIssue",
"None",
"Regression",
"Unknown"
};

public TestResultProvider
(
string name,
string outcome,
string suite,
string comment,
string attach,
string failure_type,
string error_message,
string duration
)
{
_name = name;
_outcome = outcome;
_comment = comment;
_attachment = attach;
_failure_type = failure_type;
_error_message = error_message;
_duration = duration;
if (!possibleOutcomes.Contains(_outcome))
TfsCliHelper.ExitWithError(string.Format("Outcome \"{0}\" not known.\nKnow are: {1}", _outcome, possibleOutcomes.Aggregate((a, b) => a + ", " + b)));
if (!possibleFailureTypes.Contains(_failure_type))
TfsCliHelper.ExitWithError(string.Format("Failure type {0} not know.\nKnow are: {1}", _failure_type, possibleFailureTypes.Aggregate((a, b) => a + ", " + b)));
}
public string Title() { return _name; }
public string Outcome() { return _outcome; }
public string Comment() { return _comment; }
public string Attachment() { return _attachment; }
public string FailureType() { return _failure_type; }
public string ErrorMessage() { return _error_message; }
public string Duration() { return _duration; }
}
}

0 comments on commit 70715eb

Please sign in to comment.