Skip to content

Commit 239287e

Browse files
committed
StringTypeWithLengthFixture: SQL Server CE throws different exception for oversized parameter.
1 parent ce1169f commit 239287e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/NHibernate.Test/TypesTest/StringTypeWithLengthFixture.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void ShouldPreventInsertionOfTooLongStringThatWouldBeTruncated()
9696
AssertFailedInsertExceptionDetailsAndEmptyTable(ex);
9797
}
9898

99+
99100
private void AssertFailedInsertExceptionDetailsAndEmptyTable(Exception ex)
100101
{
101102
// We can get different sort of exceptions.
@@ -114,6 +115,10 @@ private void AssertFailedInsertExceptionDetailsAndEmptyTable(Exception ex)
114115
ex.InnerException.Message,
115116
Is.EqualTo("The length of the string value exceeds the length configured in the mapping/parameter."));
116117
}
118+
else if (Dialect is MsSqlCeDialect && ex is InvalidOperationException)
119+
{
120+
Assert.That(ex.Message, Is.StringContaining("max=4000, len=4001"));
121+
}
117122
else
118123
{
119124
// In other cases, we expect the database itself to raise an error. This case

0 commit comments

Comments
 (0)