I'm trying to get test plans by using TFS API.
TfsTeamProjectCollection tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://xxxxxxx:8080/tfs/DefaultCollection"));
var service = (ITestManagementService)tfs.GetService(typeof(ITestManagementService));
The variable "service" always returns null.
Do you have any idea, why?
Try to make sure you that you are authenticated to the Team Project Collection before calling the Get Service command. This code snippet works correctly for me:
TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("https://tfs.companyname.com/tfs/DefaultCollection"));
tpc.EnsureAuthenticated();
ITestManagementService service = tpc.GetService<ITestManagementService>();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With