Skip to content

Commit b38cf4b

Browse files
committed
fixup! DB2 reports int parameters with precision
1 parent 4fa7095 commit b38cf4b

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

src/NHibernate.Test/Async/NHSpecificTest/Logs/LogsFixture.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ public async Task WillGetSessionIdFromConsecutiveSessionsLogsAsync()
118118
for (var j = 0; j < 10; j++)
119119
{
120120
var sessionId = sessions[j].GetSessionImplementation().SessionId;
121-
Assert.That(loggingEvent, Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
121+
Assert.That(
122+
loggingEvent,
123+
Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
124+
.Or.Contain($"p0 = {i * 10 + j} [Type: Int32 (4:0:0)] | SessionId: {sessionId}"));
122125
}
123126
}
124127
}
@@ -138,7 +141,10 @@ public async Task WillGetSessionIdFromInterlacedSessionsLogsAsync()
138141
for (var i = 0; i < interceptor.SessionIds.Count; i++)
139142
{
140143
var sessionId = interceptor.SessionIds[i];
141-
Assert.That(loggingEvent, Does.Contain($"p0 = {i + 1} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
144+
Assert.That(
145+
loggingEvent,
146+
Does.Contain($"p0 = {i + 1} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
147+
.Or.Contain(($"p0 = {i + 1} [Type: Int32 (4:0:0)] | SessionId: {sessionId}")));
142148
}
143149
Assert.That(loggingEvent, Does.Contain($"Person person0_ | SessionId: {s.GetSessionImplementation().SessionId}"));
144150
}
@@ -205,7 +211,10 @@ public async Task WillGetSessionIdFromSessionLogsConcurrentAsync()
205211
for (var j = 0; j < 10; j++)
206212
{
207213
var sessionId = sessionIds[i];
208-
Assert.That(loggingEvent, Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
214+
Assert.That(
215+
loggingEvent,
216+
Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
217+
.Or.Contain($"p0 = {i * 10 + j} [Type: Int32 (4:0:0)] | SessionId: {sessionId}"));
209218
}
210219
}
211220
}

src/NHibernate.Test/NHSpecificTest/Logs/LogsFixture.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ public void WillGetSessionIdFromConsecutiveSessionsLogs()
107107
for (var j = 0; j < 10; j++)
108108
{
109109
var sessionId = sessions[j].GetSessionImplementation().SessionId;
110-
Assert.That(loggingEvent, Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
110+
Assert.That(
111+
loggingEvent,
112+
Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
113+
.Or.Contain($"p0 = {i * 10 + j} [Type: Int32 (4:0:0)] | SessionId: {sessionId}"));
111114
}
112115
}
113116
}
@@ -127,7 +130,10 @@ public void WillGetSessionIdFromInterlacedSessionsLogs()
127130
for (var i = 0; i < interceptor.SessionIds.Count; i++)
128131
{
129132
var sessionId = interceptor.SessionIds[i];
130-
Assert.That(loggingEvent, Does.Contain($"p0 = {i + 1} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
133+
Assert.That(
134+
loggingEvent,
135+
Does.Contain($"p0 = {i + 1} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
136+
.Or.Contain(($"p0 = {i + 1} [Type: Int32 (4:0:0)] | SessionId: {sessionId}")));
131137
}
132138
Assert.That(loggingEvent, Does.Contain($"Person person0_ | SessionId: {s.GetSessionImplementation().SessionId}"));
133139
}
@@ -195,7 +201,10 @@ public void WillGetSessionIdFromSessionLogsConcurrent()
195201
for (var j = 0; j < 10; j++)
196202
{
197203
var sessionId = sessionIds[i];
198-
Assert.That(loggingEvent, Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
204+
Assert.That(
205+
loggingEvent,
206+
Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
207+
.Or.Contain($"p0 = {i * 10 + j} [Type: Int32 (4:0:0)] | SessionId: {sessionId}"));
199208
}
200209
}
201210
}

0 commit comments

Comments
 (0)