-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetTestCasesOfTestSet.cs
47 lines (45 loc) · 1.53 KB
/
GetTestCasesOfTestSet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rally.RestApi;
using Rally.RestApi.Response;
namespace GetTestCasesOfTestSet
{
class Program
{
static void Main(string[] args)
{
RallyRestApi restApi;
restApi = new RallyRestApi("user@co.com", "secret", "https://rally1.rallydev.com", "v2.0");
String projectRef = "/project/12352608219";
Request request = new Request("TestSet");
request.Project = projectRef;
request.Fetch = new List<string>()
{
"Name",
"FormattedID",
"TestCases"
};
request.Query = new Query("FormattedID", Query.Operator.Equals, "TS31");
QueryResult result = restApi.Query(request);
String testsetRef = result.Results.First()._ref;
DynamicJsonObject testset = restApi.GetByReference(testsetRef, "TestCases");
Request request2 = new Request(testset["TestCases"]);
request2.Fetch = new List<string>()
{
"Name",
"FormattedID"
};
request2.Limit = 1000;
QueryResult result2 = restApi.Query(request2);
int caseCount = 0;
foreach (var testcase in result2.Results)
{
Console.WriteLine("TestCase: " + testcase["FormattedID"]);
caseCount++;
}
Console.WriteLine(caseCount);
}
}
}