Last active
August 29, 2015 14:09
-
-
Save BryanWilhite/83def23d59b8b8f04288 to your computer and use it in GitHub Desktop.
C#: TfsTeamProjectCollection
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
[TestClass] | |
public class SampleTest | |
{ | |
[TestMethod] | |
public void ShouldListChangesetsByProject() | |
{ | |
using (var server = new TfsTeamProjectCollection(new Uri("http://mytfs:8080/tfs/", UriKind.Absolute))) | |
{ | |
var versionControl = server.GetService(typeof(VersionControlServer)) as VersionControlServer; | |
var set = versionControl.GetItems(@"$/MyTfsProject/MyPath", RecursionType.Full); | |
var report = string.Empty; | |
set.Items | |
.Where(i => !i.IsContentDestroyed) | |
.Where(i => i.ItemType == ItemType.File) | |
.Where(i => i.ChangesetId > 3862) | |
.ForEachInEnumerable(i => | |
{ | |
report += | |
"<include name=\"" + | |
i.ServerItem | |
.Replace("$/MyTfsProject/MyPath/", string.Empty) | |
.Replace("/", "\\") + | |
"\" />" + | |
Environment.NewLine; | |
}); | |
Assert.IsTrue(report.Length > 0); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment