Skip to content

Commit fe9bedd

Browse files
committed
Test for server warnings.
1 parent c3fa3e7 commit fe9bedd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,26 @@ public async Task InvalidCredentialsGiveProperError()
555555
}
556556
}
557557

558+
[Test]
559+
public async Task InfoMessageTest()
560+
{
561+
var messageReceived = false;
562+
await using (var conn = new FbConnection(BuildConnectionString(ServerType, Compression, WireCrypt)))
563+
{
564+
conn.InfoMessage += (object sender, FbInfoMessageEventArgs e) =>
565+
{
566+
messageReceived = e.Message.Contains("jiri", StringComparison.OrdinalIgnoreCase);
567+
};
568+
await conn.OpenAsync();
569+
await using (var cmd = conn.CreateCommand())
570+
{
571+
cmd.CommandText = "revoke select on table test from jiri";
572+
await cmd.ExecuteNonQueryAsync();
573+
}
574+
}
575+
Assert.IsTrue(messageReceived);
576+
}
577+
558578
private async Task BeginTransactionILTestsHelper(IsolationLevel level)
559579
{
560580
await using (var conn = new FbConnection(BuildConnectionString(ServerType, Compression, WireCrypt)))

0 commit comments

Comments
 (0)