Skip to content

Commit 6083cdf

Browse files
committed
Code clean up
1 parent ac4280e commit 6083cdf

File tree

8 files changed

+63
-73
lines changed

8 files changed

+63
-73
lines changed

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
using System;
2-
using RGiesecke.DllExport;
3-
using System.Runtime.InteropServices;
4-
using System.Windows.Forms;
5-
using System.Drawing;
6-
using System.Reflection;
7-
using System.IO;
1+
using RGiesecke.DllExport;
2+
using System;
83
using System.Collections.Generic;
4+
using System.Drawing;
95
using System.Linq;
6+
using System.Reflection;
7+
using System.Runtime.InteropServices;
8+
using System.Windows.Forms;
109

1110
namespace utPLSQL
1211
{
@@ -160,34 +159,34 @@ public static void RegisterCallback(int index, IntPtr function)
160159
{
161160
case 11:
162161
PlsqlDeveloperUtPlsqlPlugin.connected =
163-
(IdeConnected) Marshal.GetDelegateForFunctionPointer(function, typeof(IdeConnected));
162+
(IdeConnected)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeConnected));
164163
break;
165164
case 12:
166165
PlsqlDeveloperUtPlsqlPlugin.getConnectionInfo =
167-
(IdeGetConnectionInfo) Marshal.GetDelegateForFunctionPointer(function,
166+
(IdeGetConnectionInfo)Marshal.GetDelegateForFunctionPointer(function,
168167
typeof(IdeGetConnectionInfo));
169168
break;
170169
case 20:
171170
PlsqlDeveloperUtPlsqlPlugin.createWindow =
172-
(IdeCreateWindow) Marshal.GetDelegateForFunctionPointer(function, typeof(IdeCreateWindow));
171+
(IdeCreateWindow)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeCreateWindow));
173172
break;
174173
case 69:
175174
PlsqlDeveloperUtPlsqlPlugin.createPopupItem =
176-
(IdeCreatePopupItem) Marshal.GetDelegateForFunctionPointer(function,
175+
(IdeCreatePopupItem)Marshal.GetDelegateForFunctionPointer(function,
177176
typeof(IdeCreatePopupItem));
178177
break;
179178
case 74:
180179
PlsqlDeveloperUtPlsqlPlugin.getPopupObject =
181-
(IdeGetPopupObject) Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetPopupObject));
180+
(IdeGetPopupObject)Marshal.GetDelegateForFunctionPointer(function, typeof(IdeGetPopupObject));
182181
break;
183182
case 79:
184183
PlsqlDeveloperUtPlsqlPlugin.getObjectSource =
185-
(IdeGetObjectSource) Marshal.GetDelegateForFunctionPointer(function,
184+
(IdeGetObjectSource)Marshal.GetDelegateForFunctionPointer(function,
186185
typeof(IdeGetObjectSource));
187186
break;
188187
case 150:
189188
PlsqlDeveloperUtPlsqlPlugin.createToolButton =
190-
(IdeCreateToolButton) Marshal.GetDelegateForFunctionPointer(function,
189+
(IdeCreateToolButton)Marshal.GetDelegateForFunctionPointer(function,
191190
typeof(IdeCreateToolButton));
192191
break;
193192
}

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following

PlsqlDeveloperUtPlsqlPlugin/PlsqlDeveloperUtPlsqlPlugin/TestRunnerWindow.cs

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public TestRunnerWindow(RealTimeTestRunner testRunner)
2727
this.testRunner = testRunner;
2828
InitializeComponent();
2929

30-
var bindingSource = new BindingSource {DataSource = testResults};
30+
var bindingSource = new BindingSource { DataSource = testResults };
3131
gridResults.DataSource = bindingSource;
3232

3333
gridResults.Columns[0].HeaderText = "";
@@ -100,59 +100,59 @@ private void CollectResults(bool coverage)
100100
{
101101
if (@event.type.Equals("pre-run"))
102102
{
103-
gridResults.BeginInvoke((MethodInvoker) delegate()
104-
{
105-
totalNumberOfTests = @event.totalNumberOfTests;
103+
gridResults.BeginInvoke((MethodInvoker)delegate ()
104+
{
105+
totalNumberOfTests = @event.totalNumberOfTests;
106106

107-
progressBar.Minimum = 0;
108-
progressBar.Maximum = totalNumberOfTests * Steps;
109-
progressBar.Step = Steps;
110-
CreateTestResults(@event);
107+
progressBar.Minimum = 0;
108+
progressBar.Maximum = totalNumberOfTests * Steps;
109+
progressBar.Step = Steps;
110+
CreateTestResults(@event);
111111

112-
gridResults.Rows[0].Selected = false;
113-
});
112+
gridResults.Rows[0].Selected = false;
113+
});
114114
}
115115
else if (@event.type.Equals("post-test"))
116116
{
117-
gridResults.BeginInvoke((MethodInvoker) delegate()
118-
{
119-
completedTests++;
117+
gridResults.BeginInvoke((MethodInvoker)delegate ()
118+
{
119+
completedTests++;
120120

121-
txtTests.Text =
122-
(completedTests > totalNumberOfTests ? totalNumberOfTests : completedTests) + "/" +
123-
totalNumberOfTests;
124-
UpdateProgressBar(completedTests);
121+
txtTests.Text =
122+
(completedTests > totalNumberOfTests ? totalNumberOfTests : completedTests) + "/" +
123+
totalNumberOfTests;
124+
UpdateProgressBar(completedTests);
125125

126-
UpdateTestResult(@event);
127-
});
126+
UpdateTestResult(@event);
127+
});
128128
}
129129
else if (@event.type.Equals("post-run"))
130130
{
131-
gridResults.BeginInvoke((MethodInvoker) delegate()
132-
{
133-
txtStart.Text = @event.run.startTime.ToString(CultureInfo.CurrentCulture);
134-
txtEnd.Text = @event.run.endTime.ToString(CultureInfo.CurrentCulture);
135-
txtTime.Text = @event.run.executionTime + " s";
136-
137-
txtTests.Text =
138-
(completedTests > totalNumberOfTests ? totalNumberOfTests : completedTests) + "/" +
139-
totalNumberOfTests;
140-
txtFailures.Text = @event.run.counter.failure + "";
141-
txtErrors.Text = @event.run.counter.error + "";
142-
txtDisabled.Text = @event.run.counter.disabled + "";
143-
144-
if (@event.run.counter.failure > 0 || @event.run.counter.error > 0)
145-
{
146-
progressBar.ForeColor = Color.DarkRed;
147-
}
148-
149-
if (!coverage)
150-
{
151-
txtStatus.Text = "Finished";
152-
153-
Running = false;
154-
}
155-
});
131+
gridResults.BeginInvoke((MethodInvoker)delegate ()
132+
{
133+
txtStart.Text = @event.run.startTime.ToString(CultureInfo.CurrentCulture);
134+
txtEnd.Text = @event.run.endTime.ToString(CultureInfo.CurrentCulture);
135+
txtTime.Text = @event.run.executionTime + " s";
136+
137+
txtTests.Text =
138+
(completedTests > totalNumberOfTests ? totalNumberOfTests : completedTests) + "/" +
139+
totalNumberOfTests;
140+
txtFailures.Text = @event.run.counter.failure + "";
141+
txtErrors.Text = @event.run.counter.error + "";
142+
txtDisabled.Text = @event.run.counter.disabled + "";
143+
144+
if (@event.run.counter.failure > 0 || @event.run.counter.error > 0)
145+
{
146+
progressBar.ForeColor = Color.DarkRed;
147+
}
148+
149+
if (!coverage)
150+
{
151+
txtStatus.Text = "Finished";
152+
153+
Running = false;
154+
}
155+
});
156156
}
157157
}));
158158
}
@@ -169,7 +169,7 @@ private void CollectReport()
169169
sw.WriteLine(report);
170170
}
171171

172-
txtStatus.BeginInvoke((MethodInvoker) delegate() { txtStatus.Text = "Finished"; });
172+
txtStatus.BeginInvoke((MethodInvoker)delegate () { txtStatus.Text = "Finished"; });
173173

174174
Running = false;
175175

@@ -324,7 +324,7 @@ private void ResetComponents()
324324

325325
txtErrorMessage.Text = "";
326326

327-
var bindingSource = new BindingSource {DataSource = new BindingList<Expectation>()};
327+
var bindingSource = new BindingSource { DataSource = new BindingList<Expectation>() };
328328
gridTestFailures.DataSource = bindingSource;
329329

330330
progressBar.ForeColor = Color.Green;
@@ -472,7 +472,7 @@ private void gridResults_SelectionChanged(object sender, EventArgs e)
472472
if (gridResults.SelectedRows.Count > 0)
473473
{
474474
var row = gridResults.SelectedRows[0];
475-
var testResult = (TestResult) row.DataBoundItem;
475+
var testResult = (TestResult)row.DataBoundItem;
476476

477477
txtTestOwner.Text = testResult.Owner;
478478
txtTestPackage.Text = testResult.Package;
@@ -487,7 +487,7 @@ private void gridResults_SelectionChanged(object sender, EventArgs e)
487487

488488
txtErrorMessage.Text = testResult.Error;
489489

490-
var bindingSource = new BindingSource {DataSource = testResult.failedExpectations};
490+
var bindingSource = new BindingSource { DataSource = testResult.failedExpectations };
491491
gridTestFailures.DataSource = bindingSource;
492492

493493
gridTestFailures.Columns[0].MinimumWidth = 480;

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.Lib.Test/Program.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
6-
namespace utPLSQL.Lib.Test
1+
namespace utPLSQL.Lib.Test
72
{
83
class Program
94
{

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.Lib.Test/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.Lib/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.Lib/RealTimeTestRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public override void ConsumeResult(Action<@event> action)
112112
var xml = reader.GetString(0);
113113

114114
var serializer = new XmlSerializer(typeof(@event));
115-
var @event = (@event) serializer.Deserialize(new StringReader(xml));
115+
var @event = (@event)serializer.Deserialize(new StringReader(xml));
116116

117117
action.Invoke(@event);
118118
}

PlsqlDeveloperUtPlsqlPlugin/utPLSQL.Lib/TestRunner.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Oracle.ManagedDataAccess.Client;
22
using System;
33
using System.Data;
4-
using System.Diagnostics;
54
using System.Text;
65

76
namespace utPLSQL

0 commit comments

Comments
 (0)