Skip to content

Commit de6a33d

Browse files
committed
Prep for more functions tests and bit of refactoring.
1 parent 47e9cbb commit de6a33d

15 files changed

Lines changed: 230 additions & 211 deletions

File tree

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbBooleanSupportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public override async Task SetUp()
4040
{
4141
await base.SetUp();
4242

43-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
43+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
4444
return;
4545

4646
_shouldTearDown = true;

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbCommandTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public async Task GetCommandPlanTest()
586586
[Test]
587587
public async Task GetCommandExplainedPlanTest()
588588
{
589-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
589+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
590590
return;
591591

592592
await using (var cmd = Connection.CreateCommand())
@@ -615,7 +615,7 @@ public async Task GetCommandPlanNoPlanTest()
615615
[Test]
616616
public async Task GetCommandExplainedPlanNoPlanTest()
617617
{
618-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
618+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
619619
return;
620620

621621
await using (var cmd = Connection.CreateCommand())
@@ -690,7 +690,7 @@ public async Task ExecuteNonQueryReturnsMinusOneOnNonInsertUpdateDelete()
690690
[Test]
691691
public async Task CommandCancellationDirectTest()
692692
{
693-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
693+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
694694
return;
695695

696696
await using (var cmd = Connection.CreateCommand())
@@ -712,7 +712,7 @@ async Task Execute()
712712
[Test]
713713
public async Task CommandCancellationCancellationTokenTest()
714714
{
715-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
715+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
716716
return;
717717

718718
using (var cts = new CancellationTokenSource())
@@ -737,7 +737,7 @@ async Task Execute(CancellationToken cancellationToken)
737737
[Test]
738738
public async Task CommandUsableAfterCancellationTest()
739739
{
740-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
740+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
741741
return;
742742

743743
using (var cts = new CancellationTokenSource())
@@ -777,7 +777,7 @@ async Task Execute(CancellationToken cancellationToken)
777777
[Test]
778778
public async Task ExecuteNonQueryOnAlreadyCancelledToken()
779779
{
780-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
780+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
781781
return;
782782

783783
using (var cts = new CancellationTokenSource())

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbConnectionTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public async Task CreateDropDatabaseUsingTrustedAuth()
397397
[TestCase(true)]
398398
public async Task UseCompression(bool compression)
399399
{
400-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
400+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
401401
return;
402402
if (!EnsureServerType(FbServerType.Default))
403403
return;
@@ -424,7 +424,7 @@ public async Task UseCompression(bool compression)
424424
[TestCase(FbWireCrypt.Required)]
425425
public async Task UseWireCrypt(FbWireCrypt wireCrypt)
426426
{
427-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
427+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
428428
return;
429429
if (!EnsureServerType(FbServerType.Default))
430430
return;
@@ -495,7 +495,7 @@ public async Task DoNotGoBackToPoolAfterBroken()
495495
[Test]
496496
public async Task CaseSensitiveLogin()
497497
{
498-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
498+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
499499
return;
500500

501501
var csb = BuildConnectionStringBuilder(ServerType, Compression, WireCrypt);
@@ -622,7 +622,7 @@ public async Task ConnectionTimeoutUsingCancellationToken()
622622
[Test]
623623
public async Task SrpWithLeadingZeros()
624624
{
625-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
625+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
626626
return;
627627

628628
await using (var cmd = Connection.CreateCommand())

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbDataReaderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public async Task DNET749_CommandBehaviorCloseConnectionStackOverflow()
457457
[Test]
458458
public async Task ReadCancellation()
459459
{
460-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
460+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
461461
return;
462462

463463
using (var cts = new CancellationTokenSource())
@@ -500,7 +500,7 @@ public async Task ReadCancellation()
500500
[Test]
501501
public async Task ReadOnAlreadyCancelledToken()
502502
{
503-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
503+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
504504
return;
505505

506506
using (var cts = new CancellationTokenSource())

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloat16SupportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override async Task SetUp()
3737
{
3838
await base.SetUp();
3939

40-
if (!EnsureVersion(new Version(4, 0, 0, 0)))
40+
if (!EnsureServerVersion(new Version(4, 0, 0, 0)))
4141
return;
4242
}
4343

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloat34SupportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override async Task SetUp()
3737
{
3838
await base.SetUp();
3939

40-
if (!EnsureVersion(new Version(4, 0, 0, 0)))
40+
if (!EnsureServerVersion(new Version(4, 0, 0, 0)))
4141
return;
4242
}
4343

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbInt128SupportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override async Task SetUp()
3737
{
3838
await base.SetUp();
3939

40-
if (!EnsureVersion(new Version(4, 0, 0, 0)))
40+
if (!EnsureServerVersion(new Version(4, 0, 0, 0)))
4141
return;
4242
}
4343

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbLongNumericsSupportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public override async Task SetUp()
3636
{
3737
await base.SetUp();
3838

39-
if (!EnsureVersion(new Version(4, 0, 0, 0)))
39+
if (!EnsureServerVersion(new Version(4, 0, 0, 0)))
4040
return;
4141
}
4242

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbSchemaTests.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
//$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net)
1717

18+
using System;
1819
using System.Data;
1920
using System.Threading.Tasks;
2021
using FirebirdSql.Data.TestsBase;
@@ -99,6 +100,12 @@ public async Task ForeignKeyColumns()
99100
public async Task Functions()
100101
{
101102
await Connection.GetSchemaAsync("Functions");
103+
104+
if (ServerVersion >= new Version(3, 0, 0, 0))
105+
{
106+
var functions = Connection.GetSchema("Functions", new string[] { null, null, "TEST_FUNC" });
107+
Assert.AreEqual(1, functions.Rows.Count);
108+
}
102109
}
103110

104111
[Test]
@@ -132,10 +139,9 @@ public async Task PrimaryKeys()
132139
[Test]
133140
public async Task ProcedureParameters()
134141
{
135-
var procedureParameters = await Connection.GetSchemaAsync("ProcedureParameters");
136-
137-
procedureParameters = Connection.GetSchema("ProcedureParameters", new string[] { null, null, "SELECT_DATA" });
142+
await Connection.GetSchemaAsync("ProcedureParameters");
138143

144+
var procedureParameters = Connection.GetSchema("ProcedureParameters", new string[] { null, null, "SELECT_DATA" });
139145
Assert.AreEqual(3, procedureParameters.Rows.Count);
140146
}
141147

@@ -148,10 +154,9 @@ public async Task ProcedurePrivileges()
148154
[Test]
149155
public async Task Procedures()
150156
{
151-
var procedures = await Connection.GetSchemaAsync("Procedures");
152-
153-
procedures = Connection.GetSchema("Procedures", new string[] { null, null, "SELECT_DATA" });
157+
await Connection.GetSchemaAsync("Procedures");
154158

159+
var procedures = Connection.GetSchema("Procedures", new string[] { null, null, "SELECT_DATA" });
155160
Assert.AreEqual(1, procedures.Rows.Count);
156161
}
157162

Provider/src/FirebirdSql.Data.FirebirdClient.Tests/FbServicesTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Task RestorePart()
8686
[TestCase(false)]
8787
public async Task StreamingBackupRestoreTest(bool verbose)
8888
{
89-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
89+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
9090
return;
9191

9292
Task BackupPart(MemoryStream buffer)
@@ -194,7 +194,7 @@ public async Task ShutdownOnlineTest()
194194
[Test]
195195
public async Task ShutdownOnline2Test()
196196
{
197-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
197+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
198198
return;
199199

200200
var configurationSvc = new FbConfiguration();
@@ -273,7 +273,7 @@ public void ServerPropertiesTest()
273273
[Test]
274274
public async Task NBackupBackupRestoreTest()
275275
{
276-
if (!EnsureVersion(new Version(2, 5, 0, 0)))
276+
if (!EnsureServerVersion(new Version(2, 5, 0, 0)))
277277
return;
278278

279279
const int Levels = 2;
@@ -352,7 +352,7 @@ async Task Stop()
352352
[Test]
353353
public async Task NoLingerTest()
354354
{
355-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
355+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
356356
return;
357357

358358
var configurationSvc = new FbConfiguration();
@@ -379,7 +379,7 @@ Task Test()
379379
[Test]
380380
public async Task Validation2Test()
381381
{
382-
if (!EnsureVersion(new Version(3, 0, 0, 0)))
382+
if (!EnsureServerVersion(new Version(3, 0, 0, 0)))
383383
return;
384384

385385
var validationSvc = new FbValidation2();

0 commit comments

Comments
 (0)