forked from microsoft/azure-devops-dotnet-samples
-
Notifications
You must be signed in to change notification settings - Fork 5
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
21 changed files
with
365 additions
and
1 deletion.
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
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
40 changes: 40 additions & 0 deletions
40
VSTSRestApiSamples/ViewModels/Git/GetDiffsByRepositoryIdResponse.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,40 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace VstsRestApiSamples.ViewModels.Git | ||
{ | ||
public class GetDiffsByRepositoryIdResponse | ||
{ | ||
public class Diffs : BaseViewModel | ||
{ | ||
public bool allChangesIncluded { get; set; } | ||
public ChangeCounts changeCounts { get; set; } | ||
public List<Change> changes { get; set; } | ||
public string commonCommit { get; set; } | ||
public int aheadCount { get; set; } | ||
public int behindCount { get; set; } | ||
} | ||
|
||
public class ChangeCounts | ||
{ | ||
public int Add { get; set; } | ||
public int Edit { get; set; } | ||
} | ||
|
||
public class Item | ||
{ | ||
public string gitObjectType { get; set; } | ||
public string commitId { get; set; } | ||
public string path { get; set; } | ||
public bool isFolder { get; set; } | ||
public string url { get; set; } | ||
} | ||
|
||
public class Change | ||
{ | ||
public Item item { get; set; } | ||
public string changeType { get; set; } | ||
} | ||
|
||
|
||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
VSTSRestApiSamples/ViewModels/Git/GetStatsByRepositoryIdResponse.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,48 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace VstsRestApiSamples.ViewModels.Git | ||
{ | ||
public class GetStatsByRepositoryIdResponse | ||
{ | ||
public class Stats : BaseViewModel | ||
{ | ||
public int count { get; set; } | ||
public List<Value> value { get; set; } | ||
} | ||
|
||
public class Author | ||
{ | ||
public string name { get; set; } | ||
public string email { get; set; } | ||
public string date { get; set; } | ||
} | ||
|
||
public class Committer | ||
{ | ||
public string name { get; set; } | ||
public string email { get; set; } | ||
public string date { get; set; } | ||
} | ||
|
||
public class Commit | ||
{ | ||
public string commitId { get; set; } | ||
public Author author { get; set; } | ||
public Committer committer { get; set; } | ||
public string comment { get; set; } | ||
public string url { get; set; } | ||
public List<string> parents { get; set; } | ||
public string treeId { get; set; } | ||
} | ||
|
||
public class Value | ||
{ | ||
public Commit commit { get; set; } | ||
public string name { get; set; } | ||
public int aheadCount { get; set; } | ||
public int behindCount { get; set; } | ||
public bool isBaseVersion { get; set; } | ||
} | ||
|
||
} | ||
} |
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ProjectView>ShowAllFiles</ProjectView> | ||
</PropertyGroup> | ||
</Project> |
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,80 @@ | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using VstsClientLibrariesSamples.Git; | ||
|
||
namespace VstsClientLibrariesSamples.Tests.Git | ||
{ | ||
[TestClass] | ||
public class GitSampleTests | ||
{ | ||
private IConfiguration _configuration = new Configuration(); | ||
|
||
[TestInitialize] | ||
public void TestInitialize() | ||
{ | ||
InitHelper.GetConfiguration(_configuration); | ||
} | ||
|
||
[TestCleanup] | ||
public void TestCleanup() | ||
{ | ||
_configuration = null; | ||
} | ||
|
||
|
||
[TestMethod, TestCategory("Client Libraries")] | ||
public void Sample_GetRepositories_Success() | ||
{ | ||
var gitSample = new Sample(_configuration); | ||
|
||
try | ||
{ | ||
// act | ||
var result = gitSample.GetRepositories(); | ||
|
||
Assert.IsNotNull(result); | ||
} | ||
catch (NullReferenceException ex) | ||
{ | ||
Assert.Inconclusive(ex.Message); | ||
} | ||
} | ||
|
||
|
||
[TestMethod, TestCategory("Client Libraries")] | ||
public void Sample_GetGitCommitDiffs_Success() | ||
{ | ||
var gitSample = new Sample(_configuration); | ||
|
||
try | ||
{ | ||
// act | ||
var result = gitSample.GetGitCommitDiffs(); | ||
|
||
Assert.IsNotNull(result); | ||
} | ||
catch (NullReferenceException ex) | ||
{ | ||
Assert.Inconclusive(ex.Message); | ||
} | ||
} | ||
|
||
[TestMethod, TestCategory("Client Libraries")] | ||
public void Sample_GetGitCommitDiffsByBranch_Success() | ||
{ | ||
var gitSample = new Sample(_configuration); | ||
|
||
try | ||
{ | ||
// act | ||
var result = gitSample.GetGitCommitDiffsByBranch(); | ||
|
||
Assert.IsNotNull(result); | ||
} | ||
catch (NullReferenceException ex) | ||
{ | ||
Assert.Inconclusive(ex.Message); | ||
} | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
VstsClientLibrariesSamples.Tests/VstsClientLibrariesSamples.Tests.csproj.user
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ProjectView>ProjectFiles</ProjectView> | ||
</PropertyGroup> | ||
</Project> |
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
Oops, something went wrong.