Skip to content

Commit 72864d4

Browse files
committed
Code clean up
1 parent 6acb6e1 commit 72864d4

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
**/packages
44
**/**/bin
55
**/**/obj
6-
/.idea/
6+
**/.idea/
77
**/**/*.nupkg
8+
**/utPLSQL.Api.sln.DotSettings.user

utPLSQL.Api/utPLSQL.Api.Test/RealTimeTestRunnerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void TestGetVersion()
113113

114114
testRunner.Connect(username: "ut3_tester", password: "ut3", database: "orclpdb1");
115115

116-
string version = testRunner.GetVersion();
116+
var version = testRunner.GetVersion();
117117

118118
Assert.AreEqual("v3.1.11.3469-develop", version);
119119

@@ -129,7 +129,7 @@ public void TestGetVersionWhenNotInstalled()
129129

130130
try
131131
{
132-
string version = testRunner.GetVersion();
132+
var version = testRunner.GetVersion();
133133
Assert.Fail();
134134
}
135135
catch (OracleException e)

utPLSQL.Api/utPLSQL.Api/RealTimeTestRunner.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public override async Task RunTestsAsync(List<string> paths, Action<@event> cons
1717
{
1818
if (paths != null && paths.Count > 0)
1919
{
20-
string realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
20+
var realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
2121

22-
Task taskRun = Task.Run(() => { UtRun(realtimeReporterId, paths); });
23-
Task taskConsume = Task.Run(() => { ConsumeResult(realtimeReporterId, consumer); });
22+
var taskRun = Task.Run(() => UtRun(realtimeReporterId, paths));
23+
var taskConsume = Task.Run(() => ConsumeResult(realtimeReporterId, consumer));
2424

2525
await Task.WhenAll(taskRun, taskConsume);
2626
}
@@ -35,16 +35,16 @@ public override async Task<string> RunTestsWithCoverageAsync(List<string> paths,
3535
{
3636
if (paths != null && paths.Count > 0)
3737
{
38-
string realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
39-
string coverageReporterId = Guid.NewGuid().ToString().Replace("-", "");
38+
var realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
39+
var coverageReporterId = Guid.NewGuid().ToString().Replace("-", "");
4040

41-
Task taskRun = Task.Run(() => { UtRunWithCoverage(realtimeReporterId, coverageReporterId, paths, coverageSchemas, includeObjects, excludeObjects); });
42-
Task taskConsume = Task.Run(() => { ConsumeResult(realtimeReporterId, consumer); });
43-
Task<string> taskCoverateReport = Task.Run(() => { return GetCoverageReport(coverageReporterId); });
41+
var taskRun = Task.Run(() => UtRunWithCoverage(realtimeReporterId, coverageReporterId, paths, coverageSchemas, includeObjects, excludeObjects));
42+
var taskConsume = Task.Run(() => ConsumeResult(realtimeReporterId, consumer));
43+
var taskCoverageReport = Task.Run(() => GetCoverageReport(coverageReporterId));
4444

45-
await Task.WhenAll(taskRun, taskConsume, taskCoverateReport);
45+
await Task.WhenAll(taskRun, taskConsume, taskCoverageReport);
4646

47-
return taskCoverateReport.Result;
47+
return taskCoverageReport.Result;
4848
}
4949
else
5050
{

utPLSQL.Api/utPLSQL.Api/TestRunner.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public abstract class TestRunner<T>
1616
internal OracleConnection produceConnection;
1717
internal OracleConnection consumeConnection;
1818

19-
protected List<OracleCommand> runningCommands = new List<OracleCommand>();
19+
protected readonly List<OracleCommand> runningCommands = new List<OracleCommand>();
2020

2121
/// <summary>
2222
/// Connects to the database.
@@ -38,7 +38,7 @@ public void Connect(string username, string password, string database, string co
3838
connectionString = $"User Id={username};DBA Privilege={connectAs};Password={password};Data Source={database}";
3939
}
4040

41-
foreach (OracleCommand command in runningCommands)
41+
foreach (var command in runningCommands)
4242
{
4343
command.Cancel();
4444
}
@@ -62,7 +62,7 @@ public void Close()
6262
/// Returns the installed utPLSQL version
6363
/// </summary>
6464
/// <returns>Version as string</returns>
65-
public String GetVersion()
65+
public string GetVersion()
6666
{
6767
var cmd = new OracleCommand("select ut.version() from dual", produceConnection);
6868
runningCommands.Add(cmd);
@@ -155,7 +155,7 @@ protected string GetCoverageReport(string id)
155155
protected string ConvertToUtVarchar2List(List<string> elements)
156156
{
157157
var sb = new StringBuilder();
158-
bool first = true;
158+
var first = true;
159159
foreach (var element in elements)
160160
{
161161
if (!first)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy