Skip to content

Commit 814501d

Browse files
committed
Clean up
1 parent e7f327e commit 814501d

File tree

2 files changed

+30
-44
lines changed

2 files changed

+30
-44
lines changed

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ public class PlsqlDeveloperUtPlsqlPlugin
4343
private const int PluginPopupIndex = 1;
4444
private const int PluginPopupIndexWithCoverage = 2;
4545

46-
internal static IdeConnected connected;
47-
internal static IdeGetConnectionInfo getConnectionInfo;
48-
49-
internal static IdeCreateWindow createWindow;
50-
internal static IdeCreatePopupItem createPopupItem;
51-
internal static IdeGetPopupObject getPopupObject;
52-
internal static IdeGetObjectSource getObjectSource;
53-
internal static IdeGetConnectAs getConnectAs;
54-
internal static IdeCreateToolButton createToolButton;
55-
56-
internal static int pluginId;
57-
internal static string username;
58-
internal static string password;
59-
internal static string database;
60-
internal static string connectAs;
46+
private static IdeConnected connected;
47+
private static IdeGetConnectionInfo getConnectionInfo;
48+
49+
private static IdeCreateWindow createWindow;
50+
private static IdeCreatePopupItem createPopupItem;
51+
private static IdeGetPopupObject getPopupObject;
52+
private static IdeGetObjectSource getObjectSource;
53+
private static IdeGetConnectAs getConnectAs;
54+
private static IdeCreateToolButton createToolButton;
55+
56+
private static int pluginId;
57+
private static string username;
58+
private static string password;
59+
private static string database;
60+
private static string connectAs;
6161

6262
private static PlsqlDeveloperUtPlsqlPlugin _plugin;
6363

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.UI/TestRunnerWindow.cs

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
8585

8686
completedTests = 0;
8787

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);
8989

9090
var filePath = $"{Path.GetTempPath()}\\utPLSQL_Coverage_Report_{Guid.NewGuid()}.html";
9191
using (var sw = new StreamWriter(filePath))
@@ -95,14 +95,7 @@ public async Task RunTestsAsync(string type, string owner, string name, string p
9595

9696
txtStatus.BeginInvoke((MethodInvoker)delegate
9797
{
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";
10699
});
107100

108101
Running = false;
@@ -159,7 +152,7 @@ private Action<@event> CollectResults(bool coverage)
159152

160153
txtTests.Text = (completedTests > totalNumberOfTests ? totalNumberOfTests : completedTests) + "/" + totalNumberOfTests;
161154

162-
UpdateProgressBar(completedTests);
155+
UpdateProgressBar();
163156

164157
UpdateTestResult(@event);
165158
});
@@ -185,14 +178,7 @@ private Action<@event> CollectResults(bool coverage)
185178

186179
if (!coverage)
187180
{
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";
196182
Running = false;
197183
}
198184
});
@@ -226,7 +212,7 @@ private List<string> ConvertToList(string listValue)
226212
}
227213
else
228214
{
229-
return new List<string>() { listValue };
215+
return new List<string> { listValue };
230216
}
231217
}
232218
}
@@ -235,9 +221,9 @@ private List<string> ConvertToList(string listValue)
235221
* Workaround for the progressbar animation that produces lagging
236222
* https://stackoverflow.com/questions/5332616/disabling-net-progressbar-animation-when-changing-value
237223
*/
238-
private void UpdateProgressBar(int completedTests)
224+
private void UpdateProgressBar()
239225
{
240-
int newValue = completedTests * Steps + 1;
226+
var newValue = completedTests * Steps + 1;
241227
if (newValue > progressBar.Maximum)
242228
{
243229
progressBar.Value = progressBar.Maximum;
@@ -257,21 +243,21 @@ private void SetWindowTitle(string type, string owner, string name, string proce
257243
txtStart.Text = startTime;
258244
var path = GetPath(type, owner, name, procedure);
259245
txtPath.Text = path[0];
260-
this.Text = $"{path[0]} {startTime}";
246+
Text = $"{path[0]} {startTime}";
261247
}
262248

263249
private List<string> GetPath(string type, string owner, string name, string procedure)
264250
{
265251
switch (type)
266252
{
267253
case "USER":
268-
return new List<string>() { name };
254+
return new List<string> { name };
269255
case "PACKAGE":
270-
return new List<string>() { $"{owner}.{name}" };
256+
return new List<string> { $"{owner}.{name}" };
271257
case "PROCEDURE":
272-
return new List<string>() { $"{owner}.{name}.{procedure}" };
258+
return new List<string> { $"{owner}.{name}.{procedure}" };
273259
default:
274-
return new List<string>() { owner };
260+
return new List<string> { owner };
275261
}
276262
}
277263

@@ -374,7 +360,7 @@ private void UpdateTestResult(@event @event)
374360
}
375361
catch
376362
{
377-
// ingore exception that could raise if results are filtered
363+
// ignore exception that could raise if results are filtered
378364
}
379365
}
380366
}
@@ -469,7 +455,7 @@ private void FilterTestResults()
469455
}
470456
}
471457

472-
private void btnClose_Click(object sender, System.EventArgs e)
458+
private void btnClose_Click(object sender, EventArgs e)
473459
{
474460
Close();
475461
}
@@ -502,7 +488,7 @@ private void gridResults_SelectionChanged(object sender, EventArgs e)
502488
if (gridResults.SelectedRows.Count > 0)
503489
{
504490
var row = gridResults.SelectedRows[0];
505-
ObjectView<TestResult> dataBoundItem = (ObjectView<TestResult>)row.DataBoundItem;
491+
var dataBoundItem = (ObjectView<TestResult>)row.DataBoundItem;
506492
var testResult = dataBoundItem.Object;
507493

508494
txtTestOwner.Text = testResult.Owner;

0 commit comments

Comments
 (0)