@@ -18,10 +18,11 @@ public void Should_Throw_If_FilePathExpression_Is_Null()
18
18
var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
19
19
string filePathExpression = null ;
20
20
var lineExpression = "line" ;
21
+ var endLineExpression = "endLine" ;
21
22
22
23
// When
23
24
var result = Record . Exception ( ( ) =>
24
- ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ) ;
25
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
25
26
26
27
// Then
27
28
result . IsArgumentNullException ( "filePathExpression" ) ;
@@ -34,10 +35,11 @@ public void Should_Throw_If_FilePathExpression_Is_Empty()
34
35
var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
35
36
var filePathExpression = string . Empty ;
36
37
var lineExpression = "line" ;
38
+ var endLineExpression = "endLine" ;
37
39
38
40
// When
39
41
var result = Record . Exception ( ( ) =>
40
- ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ) ;
42
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
41
43
42
44
// Then
43
45
result . IsArgumentOutOfRangeException ( "filePathExpression" ) ;
@@ -50,10 +52,11 @@ public void Should_Throw_If_FilePathExpression_Is_WhiteSpace()
50
52
var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
51
53
var filePathExpression = " " ;
52
54
var lineExpression = "line" ;
55
+ var endLineExpression = "endLine" ;
53
56
54
57
// When
55
58
var result = Record . Exception ( ( ) =>
56
- ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ) ;
59
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
57
60
58
61
// Then
59
62
result . IsArgumentOutOfRangeException ( "filePathExpression" ) ;
@@ -66,10 +69,11 @@ public void Should_Throw_If_LineExpression_Is_Null()
66
69
var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
67
70
var filePathExpression = "file" ;
68
71
string lineExpression = null ;
72
+ var endLineExpression = "endLine" ;
69
73
70
74
// When
71
75
var result = Record . Exception ( ( ) =>
72
- ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ) ;
76
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
73
77
74
78
// Then
75
79
result . IsArgumentNullException ( "lineExpression" ) ;
@@ -82,10 +86,11 @@ public void Should_Throw_If_LineExpression_Is_Empty()
82
86
var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
83
87
var filePathExpression = "file" ;
84
88
var lineExpression = string . Empty ;
89
+ var endLineExpression = "endLine" ;
85
90
86
91
// When
87
92
var result = Record . Exception ( ( ) =>
88
- ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ) ;
93
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
89
94
90
95
// Then
91
96
result . IsArgumentOutOfRangeException ( "lineExpression" ) ;
@@ -98,25 +103,78 @@ public void Should_Throw_If_LineExpression_Is_WhiteSpace()
98
103
var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
99
104
var filePathExpression = "file" ;
100
105
var lineExpression = " " ;
106
+ var endLineExpression = "endLine" ;
101
107
102
108
// When
103
109
var result = Record . Exception ( ( ) =>
104
- ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ) ;
110
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
105
111
106
112
// Then
107
113
result . IsArgumentOutOfRangeException ( "lineExpression" ) ;
108
114
}
109
115
116
+ [ Fact ]
117
+ public void Should_Throw_If_EndLineExpression_Is_Null ( )
118
+ {
119
+ // Given
120
+ var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
121
+ var filePathExpression = "file" ;
122
+ var lineExpression = "line" ;
123
+ string endLineExpression = null ;
124
+
125
+ // When
126
+ var result = Record . Exception ( ( ) =>
127
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
128
+
129
+ // Then
130
+ result . IsArgumentNullException ( "endLineExpression" ) ;
131
+ }
132
+
133
+ [ Fact ]
134
+ public void Should_Throw_If_EndLineExpression_Is_Empty ( )
135
+ {
136
+ // Given
137
+ var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
138
+ var filePathExpression = "file" ;
139
+ var lineExpression = "line" ;
140
+ var endLineExpression = string . Empty ;
141
+
142
+ // When
143
+ var result = Record . Exception ( ( ) =>
144
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
145
+
146
+ // Then
147
+ result . IsArgumentOutOfRangeException ( "endLineExpression" ) ;
148
+ }
149
+
150
+ [ Fact ]
151
+ public void Should_Throw_If_EndLineExpression_Is_WhiteSpace ( )
152
+ {
153
+ // Given
154
+ var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
155
+ var filePathExpression = "file" ;
156
+ var lineExpression = "line" ;
157
+ var endLineExpression = " " ;
158
+
159
+ // When
160
+ var result = Record . Exception ( ( ) =>
161
+ ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ) ;
162
+
163
+ // Then
164
+ result . IsArgumentOutOfRangeException ( "endLineExpression" ) ;
165
+ }
166
+
110
167
[ Fact ]
111
168
public void Should_Return_Null_If_OpenInIdeCall_Is_Not_Set ( )
112
169
{
113
170
// Given
114
171
var ideIntegrationSettings = new IdeIntegrationSettings ( ) ;
115
172
var filePathExpression = "file" ;
116
173
var lineExpression = "line" ;
174
+ var endLineExpression = "endLine" ;
117
175
118
176
// When
119
- var result = ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ;
177
+ var result = ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ;
120
178
121
179
// Then
122
180
result . ShouldBeNull ( ) ;
@@ -133,9 +191,10 @@ public void Should_Replace_FilePath_Token()
133
191
} ;
134
192
var filePathExpression = "file" ;
135
193
var lineExpression = "line" ;
194
+ var endLineExpression = "endLine" ;
136
195
137
196
// When
138
- var result = ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ;
197
+ var result = ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ;
139
198
140
199
// Then
141
200
result . ShouldBe ( "FoofileBar" ) ;
@@ -152,13 +211,34 @@ public void Should_Replace_Line_Token()
152
211
} ;
153
212
var filePathExpression = "file" ;
154
213
var lineExpression = "line" ;
214
+ var endLineExpression = "endLine" ;
155
215
156
216
// When
157
- var result = ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression ) ;
217
+ var result = ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ;
158
218
159
219
// Then
160
220
result . ShouldBe ( "FoolineBar" ) ;
161
221
}
222
+
223
+ [ Fact ]
224
+ public void Should_Replace_EndLine_Token ( )
225
+ {
226
+ // Given
227
+ var ideIntegrationSettings =
228
+ new IdeIntegrationSettings
229
+ {
230
+ OpenInIdeCall = "Foo{EndLine}Bar" ,
231
+ } ;
232
+ var filePathExpression = "file" ;
233
+ var lineExpression = "line" ;
234
+ var endLineExpression = "endLine" ;
235
+
236
+ // When
237
+ var result = ideIntegrationSettings . GetOpenInIdeCall ( filePathExpression , lineExpression , endLineExpression ) ;
238
+
239
+ // Then
240
+ result . ShouldBe ( "FooendLineBar" ) ;
241
+ }
162
242
}
163
243
}
164
244
}
0 commit comments