Skip to content

Commit 5748ee0

Browse files
bahusoidfredericDelaporte
authored andcommitted
Fix possible test failure for SqlServer 2019
1 parent 7c4cc42 commit 5748ee0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/NHibernate.Test/Async/NHSpecificTest/GH1300/Fixture.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ public void InsertWithTooLongValuesShouldThrowAsync()
114114

115115
var sqlEx = ex.InnerException as SqlException;
116116
Assert.That(sqlEx, Is.Not.Null);
117-
Assert.That(sqlEx.Number, Is.EqualTo(8152));
117+
// Error code is different if verbose truncation warning is enabled
118+
// See details: https://www.brentozar.com/archive/2019/03/how-to-fix-the-error-string-or-binary-data-would-be-truncated/
119+
Assert.That(sqlEx.Number, Is.EqualTo(8152).Or.EqualTo(2628));
118120
}
119121
}
120122

src/NHibernate.Test/NHSpecificTest/GH1300/Fixture.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ public void InsertWithTooLongValuesShouldThrow()
103103

104104
var sqlEx = ex.InnerException as SqlException;
105105
Assert.That(sqlEx, Is.Not.Null);
106-
Assert.That(sqlEx.Number, Is.EqualTo(8152));
106+
// Error code is different if verbose truncation warning is enabled
107+
// See details: https://www.brentozar.com/archive/2019/03/how-to-fix-the-error-string-or-binary-data-would-be-truncated/
108+
Assert.That(sqlEx.Number, Is.EqualTo(8152).Or.EqualTo(2628));
107109
}
108110
}
109111

0 commit comments

Comments
 (0)