forked from resgroup/customer-tests-excel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CombinedTestOutputWriter.cs
213 lines (184 loc) · 5.72 KB
/
CombinedTestOutputWriter.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CustomerTestsExcel
{
public class CombinedTestOutputWriter : ITestOutputWriter
{
protected readonly List<ITestOutputWriter> _writers;
public CombinedTestOutputWriter(List<ITestOutputWriter> writers)
{
if (writers == null) throw new ArgumentNullException("writers");
_writers = writers;
}
public void StartSpecification(string specificationNamespace, string specificationName, string specificationDescription)
{
foreach (var writer in _writers)
{
writer.StartSpecification(specificationNamespace, specificationName, specificationDescription);
}
}
public void StartGiven()
{
foreach (var writer in _writers)
{
writer.StartGiven();
}
}
public void StartClass(string className)
{
foreach (var writer in _writers)
{
writer.StartClass(className);
}
}
public void StartGivenProperties()
{
foreach (var writer in _writers)
{
writer.StartGivenProperties();
}
}
public void GivenProperty(ReportSpecificationSetupProperty property)
{
foreach (var writer in _writers)
{
writer.GivenProperty(property);
}
}
public void GivenClassProperty(string propertyName, bool isChild, int? indexInParent, bool isNull)
{
foreach (var writer in _writers)
{
writer.GivenClassProperty(propertyName, isChild, indexInParent, isNull);
}
}
public void EndGivenProperties()
{
foreach (var writer in _writers)
{
writer.EndGivenProperties();
}
}
public void StartSubClass(string className)
{
foreach (var writer in _writers)
{
writer.StartSubClass(className);
}
}
public void EndSubClass()
{
foreach (var writer in _writers)
{
writer.EndSubClass();
}
}
public void EndGiven()
{
foreach (var writer in _writers)
{
writer.EndGiven();
}
}
public void When(string actionName)
{
foreach (var writer in _writers)
{
writer.When(actionName);
}
}
public void StartAssertions()
{
foreach (var writer in _writers)
{
writer.StartAssertions();
}
}
public void Assert(string assertPropertyName, object assertPropertyExpectedValue, AssertionOperator assertionOperator, object assertPropertyActualValue, bool passed, IEnumerable<string> assertionSpecifics)
{
foreach (var writer in _writers)
{
writer.Assert(assertPropertyName, assertPropertyExpectedValue, assertionOperator, assertPropertyActualValue, passed, assertionSpecifics);
}
}
public void EndAssertions()
{
foreach (var writer in _writers)
{
writer.EndAssertions();
}
}
public void EndSpecification(string specificationNamespace, bool passed)
{
foreach (var writer in _writers)
{
writer.EndSpecification(specificationNamespace, passed);
}
}
public void Exception(string exception)
{
foreach (var writer in _writers)
{
writer.Exception(exception);
}
}
public void CodeValueDoesNotMatchExcelFormula(string assertPropertyName, string excelValue, string csharpValue)
{
foreach (var writer in _writers)
{
writer.CodeValueDoesNotMatchExcelFormula(assertPropertyName, excelValue, csharpValue);
}
}
public void StartAssertionSubProperties(string assertPropertyName, bool exists, string cSharpClassName, bool passed)
{
foreach (var writer in _writers)
{
writer.StartAssertionSubProperties(assertPropertyName, exists, cSharpClassName, passed);
}
}
public void EndAssertionSubProperties()
{
foreach (var writer in _writers)
{
writer.EndAssertionSubProperties();
}
}
public void EndClass()
{
foreach (var writer in _writers)
{
writer.EndClass();
}
}
public void StartClassTable(string propertyName, string className)
{
foreach (var writer in _writers)
{
writer.StartClassTable(propertyName, className);
}
}
public void ClassTablePropertyNamesHeaderRow(IEnumerable<string> propertyNames)
{
foreach (var writer in _writers)
{
writer.ClassTablePropertyNamesHeaderRow(propertyNames);
}
}
public void ClassTablePropertyRow(IEnumerable<ReportSpecificationSetupProperty> cells)
{
foreach (var writer in _writers)
{
writer.ClassTablePropertyRow(cells);
}
}
public void EndClassTable()
{
foreach (var writer in _writers)
{
writer.EndClassTable();
}
}
}
}