This repository has been archived by the owner on Dec 28, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
312 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Contribution Guidelines | ||
|
||
This repository uses [GitFlow] with default configuration. | ||
Development is happening on `develop` branch. | ||
|
||
To contribute: | ||
|
||
* Fork this repository. | ||
* Create a feature branch from `develop`. | ||
* Implement your changes. | ||
* Push your feature branch. | ||
* Create a pull request. | ||
|
||
## Build | ||
|
||
To build this package we are using Cake. | ||
|
||
On Windows PowerShell run: | ||
|
||
```powershell | ||
./build | ||
``` | ||
|
||
On OSX/Linux run: | ||
|
||
```bash | ||
./build.sh | ||
``` | ||
|
||
## Release | ||
|
||
See [Cake.Recipe documentation] how to create a new release of this addin. | ||
|
||
[GitFlow]: (http://nvie.com/posts/a-successful-git-branching-model/) | ||
[Cake.Recipe documentation]: https://cake-contrib.github.io/Cake.Recipe/docs/usage/creating-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/Cake.Prca.PullRequests.Tfs.Tests/ContentProviderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
namespace Cake.Prca.PullRequests.Tfs.Tests | ||
{ | ||
using System; | ||
using Issues; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
public class ContentProviderTests | ||
{ | ||
public sealed class TheGetContentClass | ||
{ | ||
[Theory] | ||
[InlineData( | ||
@"foo.cs", | ||
123, | ||
"Some message", | ||
1, | ||
"foo", | ||
null, | ||
"foo: Some message")] | ||
[InlineData( | ||
@"foo.cs", | ||
123, | ||
"Some message", | ||
1, | ||
"", | ||
null, | ||
"Some message")] | ||
[InlineData( | ||
@"foo.cs", | ||
123, | ||
"Some message", | ||
1, | ||
" ", | ||
null, | ||
"Some message")] | ||
[InlineData( | ||
@"foo.cs", | ||
123, | ||
"Some message", | ||
1, | ||
"foo", | ||
"http://google.com", | ||
"[foo](http://google.com/): Some message")] | ||
public void Should_Return_Correct_Value( | ||
string filePath, | ||
int? line, | ||
string message, | ||
int priority, | ||
string rule, | ||
string ruleUrl, | ||
string expectedResult) | ||
{ | ||
// Given | ||
Uri ruleUri = null; | ||
if (!string.IsNullOrWhiteSpace(ruleUrl)) | ||
{ | ||
ruleUri = new Uri(ruleUrl); | ||
} | ||
|
||
var issue = new CodeAnalysisIssue(filePath, line, message, priority, rule, ruleUri, "Foo"); | ||
|
||
// When | ||
var result = ContentProvider.GetContent(issue); | ||
|
||
// Then | ||
result.ShouldBe(expectedResult); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.