@@ -85,7 +85,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
85
85
86
86
completedTests = 0 ;
87
87
88
- string htmlReport = await testRunner . RunTestsWithCoverageAsync ( GetPath ( type , owner , name , procedure ) , CollectResults ( coverage ) , schemas , includes , excludes ) ;
88
+ var htmlReport = await testRunner . RunTestsWithCoverageAsync ( GetPath ( type , owner , name , procedure ) , CollectResults ( coverage ) , schemas , includes , excludes ) ;
89
89
90
90
var filePath = $ "{ Path . GetTempPath ( ) } \\ utPLSQL_Coverage_Report_{ Guid . NewGuid ( ) } .html";
91
91
using ( var sw = new StreamWriter ( filePath ) )
@@ -95,14 +95,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
95
95
96
96
txtStatus . BeginInvoke ( ( MethodInvoker ) delegate
97
97
{
98
- if ( totalNumberOfTests > 0 )
99
- {
100
- txtStatus . Text = "Finished" ;
101
- }
102
- else
103
- {
104
- txtStatus . Text = "No tests found" ;
105
- }
98
+ txtStatus . Text = totalNumberOfTests > 0 ? "Finished" : "No tests found" ;
106
99
} ) ;
107
100
108
101
Running = false ;
@@ -159,7 +152,7 @@ private Action<@event> CollectResults(bool coverage)
159
152
160
153
txtTests . Text = ( completedTests > totalNumberOfTests ? totalNumberOfTests : completedTests ) + "/" + totalNumberOfTests ;
161
154
162
- UpdateProgressBar ( completedTests ) ;
155
+ UpdateProgressBar ( ) ;
163
156
164
157
UpdateTestResult ( @event ) ;
165
158
} ) ;
@@ -185,14 +178,7 @@ private Action<@event> CollectResults(bool coverage)
185
178
186
179
if ( ! coverage )
187
180
{
188
- if ( totalNumberOfTests > 0 )
189
- {
190
- txtStatus . Text = "Finished" ;
191
- }
192
- else
193
- {
194
- txtStatus . Text = "No tests found" ;
195
- }
181
+ txtStatus . Text = totalNumberOfTests > 0 ? "Finished" : "No tests found" ;
196
182
Running = false ;
197
183
}
198
184
} ) ;
@@ -226,7 +212,7 @@ private List<string> ConvertToList(string listValue)
226
212
}
227
213
else
228
214
{
229
- return new List < string > ( ) { listValue } ;
215
+ return new List < string > { listValue } ;
230
216
}
231
217
}
232
218
}
@@ -235,9 +221,9 @@ private List<string> ConvertToList(string listValue)
235
221
* Workaround for the progressbar animation that produces lagging
236
222
* https://stackoverflow.com/questions/5332616/disabling-net-progressbar-animation-when-changing-value
237
223
*/
238
- private void UpdateProgressBar ( int completedTests )
224
+ private void UpdateProgressBar ( )
239
225
{
240
- int newValue = completedTests * Steps + 1 ;
226
+ var newValue = completedTests * Steps + 1 ;
241
227
if ( newValue > progressBar . Maximum )
242
228
{
243
229
progressBar . Value = progressBar . Maximum ;
@@ -257,21 +243,21 @@ private void SetWindowTitle(string type, string owner, string name, string proce
257
243
txtStart . Text = startTime ;
258
244
var path = GetPath ( type , owner , name , procedure ) ;
259
245
txtPath . Text = path [ 0 ] ;
260
- this . Text = $ "{ path [ 0 ] } { startTime } ";
246
+ Text = $ "{ path [ 0 ] } { startTime } ";
261
247
}
262
248
263
249
private List < string > GetPath ( string type , string owner , string name , string procedure )
264
250
{
265
251
switch ( type )
266
252
{
267
253
case "USER" :
268
- return new List < string > ( ) { name } ;
254
+ return new List < string > { name } ;
269
255
case "PACKAGE" :
270
- return new List < string > ( ) { $ "{ owner } .{ name } " } ;
256
+ return new List < string > { $ "{ owner } .{ name } " } ;
271
257
case "PROCEDURE" :
272
- return new List < string > ( ) { $ "{ owner } .{ name } .{ procedure } " } ;
258
+ return new List < string > { $ "{ owner } .{ name } .{ procedure } " } ;
273
259
default :
274
- return new List < string > ( ) { owner } ;
260
+ return new List < string > { owner } ;
275
261
}
276
262
}
277
263
@@ -374,7 +360,7 @@ private void UpdateTestResult(@event @event)
374
360
}
375
361
catch
376
362
{
377
- // ingore exception that could raise if results are filtered
363
+ // ignore exception that could raise if results are filtered
378
364
}
379
365
}
380
366
}
@@ -469,7 +455,7 @@ private void FilterTestResults()
469
455
}
470
456
}
471
457
472
- private void btnClose_Click ( object sender , System . EventArgs e )
458
+ private void btnClose_Click ( object sender , EventArgs e )
473
459
{
474
460
Close ( ) ;
475
461
}
@@ -502,7 +488,7 @@ private void gridResults_SelectionChanged(object sender, EventArgs e)
502
488
if ( gridResults . SelectedRows . Count > 0 )
503
489
{
504
490
var row = gridResults . SelectedRows [ 0 ] ;
505
- ObjectView < TestResult > dataBoundItem = ( ObjectView < TestResult > ) row . DataBoundItem ;
491
+ var dataBoundItem = ( ObjectView < TestResult > ) row . DataBoundItem ;
506
492
var testResult = dataBoundItem . Object ;
507
493
508
494
txtTestOwner . Text = testResult . Owner ;
0 commit comments