@@ -67,11 +67,7 @@ private void CreateDataSourceAndConfigureGridColumns()
67
67
68
68
public async Task RunTestsAsync ( string type , string owner , string name , string procedure , bool coverage )
69
69
{
70
- ResetComponents ( ) ;
71
-
72
- testResults . Clear ( ) ;
73
-
74
- SetWindowTitle ( type , owner , name , procedure ) ;
70
+ var path = GetPath ( type , owner , name , procedure ) ;
75
71
76
72
testRunner = new RealTimeTestRunner ( ) ;
77
73
@@ -98,11 +94,22 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
98
94
return ;
99
95
}
100
96
97
+ await RunTestsAsync ( path , coverage ) ;
98
+ }
99
+
100
+ private async Task RunTestsAsync ( List < string > path , bool coverage )
101
+ {
102
+ ResetComponents ( ) ;
103
+
104
+ testResults . Clear ( ) ;
105
+
106
+ SetWindowTitle ( path ) ;
107
+
101
108
Running = true ;
102
109
103
110
if ( coverage )
104
111
{
105
- var codeCoverageReportDialog = new CodeCoverageReportDialog ( GetPath ( type , owner , name , procedure ) ) ;
112
+ var codeCoverageReportDialog = new CodeCoverageReportDialog ( path ) ;
106
113
var dialogResult = codeCoverageReportDialog . ShowDialog ( ) ;
107
114
if ( dialogResult == DialogResult . OK )
108
115
{
@@ -116,7 +123,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
116
123
117
124
txtStatus . Text = "Running tests with coverage..." ;
118
125
119
- var htmlReport = await testRunner . RunTestsWithCoverageAsync ( GetPath ( type , owner , name , procedure ) , CollectResults ( coverage ) , schemas , includes , excludes ) ;
126
+ var htmlReport = await testRunner . RunTestsWithCoverageAsync ( path , CollectResults ( coverage ) , schemas , includes , excludes ) ;
120
127
121
128
var filePath = $ "{ Path . GetTempPath ( ) } \\ utPLSQL_Coverage_Report_{ Guid . NewGuid ( ) } .html";
122
129
using ( var sw = new StreamWriter ( filePath ) )
@@ -144,7 +151,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
144
151
145
152
txtStatus . Text = "Running tests..." ;
146
153
147
- await testRunner . RunTestsAsync ( GetPath ( type , owner , name , procedure ) , CollectResults ( coverage ) ) ;
154
+ await testRunner . RunTestsAsync ( path , CollectResults ( coverage ) ) ;
148
155
}
149
156
}
150
157
@@ -278,11 +285,10 @@ private void UpdateProgressBar()
278
285
}
279
286
}
280
287
281
- private void SetWindowTitle ( string type , string owner , string name , string procedure )
288
+ private void SetWindowTitle ( List < string > path )
282
289
{
283
290
var startTime = DateTime . Now . ToString ( CultureInfo . CurrentCulture ) ;
284
291
txtStart . Text = startTime ;
285
- var path = GetPath ( type , owner , name , procedure ) ;
286
292
txtPath . Text = path [ 0 ] ;
287
293
Text = $ "{ path [ 0 ] } { startTime } ";
288
294
}
@@ -644,5 +650,15 @@ private void cbDisabled_CheckedChanged(object sender, EventArgs e)
644
650
{
645
651
FilterTestResults ( ) ;
646
652
}
653
+
654
+ private async void btnRun_Click ( object sender , EventArgs e )
655
+ {
656
+ await RunTestsAsync ( new List < string > { txtPath . Text } , false ) ;
657
+ }
658
+
659
+ private async void button1_Click ( object sender , EventArgs e )
660
+ {
661
+ await RunTestsAsync ( new List < string > { txtPath . Text } , true ) ;
662
+ }
647
663
}
648
664
}
0 commit comments