-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from JetBrains/issue-26
#25 Support test metadata
- Loading branch information
Showing
18 changed files
with
385 additions
and
25 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 |
---|---|---|
|
@@ -10,3 +10,4 @@ _ReSharper.Caches | |
.vs/ | ||
*.user | ||
IntegrationTests/global.json | ||
.idea/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace TeamCity.VSTest.TestLogger.Tests | ||
{ | ||
using Shouldly; | ||
using Xunit; | ||
|
||
public class TeamCityVersionTest | ||
{ | ||
[Theory] | ||
[InlineData("2018.1", "2018.2", -1)] | ||
[InlineData("2018.1", "2018.2 (build SNAPSHOT)", -1)] | ||
[InlineData("2018.2", "2018.2 (build SNAPSHOT)", 0)] | ||
[InlineData("2018.2 (build SNAPSHOT)", "2018.2 (build SNAPSHOT)", 0)] | ||
[InlineData("2018.2 (build SNAPSHOT)", "2018.2 (build SNAPSHOT 2)", 0)] | ||
[InlineData("2018.2 (build SNAPSHOT)", "2018.1", 1)] | ||
[InlineData("", "2018.2 (build SNAPSHOT)", -1)] | ||
[InlineData("2018.2 (build SNAPSHOT)", "", 1)] | ||
[InlineData("2018.2", "2018.2", 0)] | ||
[InlineData("2018.2.1", "2018.2", 0)] | ||
[InlineData(null, "2018.2", -1)] | ||
[InlineData("", "", 0)] | ||
[InlineData(null, "", 0)] | ||
[InlineData(null, null, 0)] | ||
[InlineData("", "abc", 0)] | ||
[InlineData(".32323", "abc", 0)] | ||
[InlineData("2018", "2018", 0)] | ||
[InlineData("2018", "2018.1", -1)] | ||
[InlineData("10", "11", -1)] | ||
[InlineData("12", "11", 1)] | ||
public void ShouldCompareTeamCityVersions(string version1, string version2, int expectedCompareResult) | ||
{ | ||
// Given | ||
var v1 = new TeamCityVersion(version1); | ||
var v2 = new TeamCityVersion(version2); | ||
|
||
// When | ||
var actualCompareResult = v1.CompareTo(v2); | ||
|
||
// Then | ||
actualCompareResult.ShouldBe(expectedCompareResult); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace TeamCity.VSTest.TestLogger | ||
{ | ||
internal interface IIdGenerator | ||
{ | ||
string NewId(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace TeamCity.VSTest.TestLogger | ||
{ | ||
using System; | ||
using System.Linq; | ||
|
||
internal class IdGenerator : IIdGenerator | ||
{ | ||
public string NewId() => new string(Guid.NewGuid().ToString().Where(c => c != '-').ToArray()); | ||
} | ||
} |
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
Oops, something went wrong.