-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestsWriter.cs
37 lines (32 loc) · 1.03 KB
/
TestsWriter.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
using System;
using System.Collections.Generic;
using System.IO;
namespace tfs_cli
{
abstract class TestsWriter
{
protected string _output;
protected ITfsCliBuilder _builder;
protected ConnectionData _conData;
public TestsWriter(string output, ConnectionData con, ITfsCliBuilder builder)
{
_conData = con;
_output = output;
_builder = builder;
}
public void CreateOutput()
{
ITfsCliConnector connector = new CredentialConnector(_conData);
connector.Connect();
// generate header
_builder.Header(_conData.Url(), _conData.Project(), _conData.Testplan());
TfsApi tfsapi = new TfsApi(connector.Collection(), _conData);
foreach (var suite in tfsapi.GetSuites())
{
_builder.Append(suite);
}
WriteToOutput();
}
abstract protected void WriteToOutput();
}
}