Skip to content

Commit e5d9d3d

Browse files
fixup! Added more properties to the test entity
Regen async tests
1 parent 5cd9d27 commit e5d9d3d

File tree

1 file changed

+10
-26
lines changed
  • src/NHibernate.Test/Async/NHSpecificTest/GH1300

1 file changed

+10
-26
lines changed

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

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ public async Task InsertShouldUseMappedSizeAsync()
8282
using (var session = OpenSession())
8383
using (var transaction = session.BeginTransaction())
8484
{
85-
var e1 = new Entity { Name = "Al", AnsiName = "Al" };
85+
var e1 = new Entity { Name = "1", AnsiName = "2", FullText = "3", AnsiFullText = "4" };
8686
await (session.SaveAsync(e1));
8787
await (transaction.CommitAsync());
88-
Assert.That(Driver.LastCommandParameters.First().SqlDbType, Is.EqualTo(SqlDbType.NVarChar));
89-
Assert.That(Driver.LastCommandParameters.First().Size, Is.EqualTo(3));
90-
Assert.That(Driver.LastCommandParameters.Last().SqlDbType, Is.EqualTo(SqlDbType.VarChar));
91-
Assert.That(Driver.LastCommandParameters.Last().Size, Is.EqualTo(3));
88+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "1").SqlDbType, Is.EqualTo(SqlDbType.NVarChar));
89+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "1").Size, Is.EqualTo(3));
90+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "2").SqlDbType, Is.EqualTo(SqlDbType.VarChar));
91+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "2").Size, Is.EqualTo(3));
92+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "3").SqlDbType, Is.EqualTo(SqlDbType.NVarChar));
93+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "3").Size, Is.EqualTo(MsSql2000Dialect.MaxSizeForClob));
94+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "4").SqlDbType, Is.EqualTo(SqlDbType.VarChar));
95+
Assert.That(Driver.LastCommandParameters.Single(x => (string) x.Value == "4").Size, Is.EqualTo(MsSql2000Dialect.MaxSizeForAnsiClob));
9296
}
9397
}
9498

@@ -151,27 +155,7 @@ public async Task MappedAsShouldUseExplicitSizeAsync()
151155
Assert.That(Driver.LastCommandParameters.First().SqlDbType, Is.EqualTo(SqlDbType.VarChar));
152156
}
153157
}
154-
155-
[Test]
156-
public async Task LongStringCausesClobSizedParameterAsync()
157-
{
158-
Driver.ClearCommands();
159-
160-
using (var session = OpenSession())
161-
using (var transaction = session.BeginTransaction())
162-
{
163-
await (session.Query<Entity>().Where(x => x.Name == new string('x', MsSql2000Dialect.MaxSizeForLengthLimitedString + 1)).ToListAsync());
164-
165-
Assert.That(Driver.LastCommandParameters.First().Size, Is.EqualTo(MsSql2000Dialect.MaxSizeForClob));
166-
Assert.That(Driver.LastCommandParameters.First().SqlDbType, Is.EqualTo(SqlDbType.NVarChar));
167-
168-
await (session.Query<Entity>().Where(x => x.AnsiName == new string('x', MsSql2000Dialect.MaxSizeForLengthLimitedAnsiString + 1)).ToListAsync());
169-
170-
Assert.That(Driver.LastCommandParameters.First().Size, Is.EqualTo(MsSql2000Dialect.MaxSizeForAnsiClob));
171-
Assert.That(Driver.LastCommandParameters.First().SqlDbType, Is.EqualTo(SqlDbType.VarChar));
172-
}
173-
}
174-
158+
175159
[TestCase("Name", SqlDbType.NVarChar)]
176160
[TestCase("AnsiName", SqlDbType.VarChar)]
177161
public async Task HqlLikeShouldUseLargerSizeAsync(string property, SqlDbType expectedDbType, CancellationToken cancellationToken = default(CancellationToken))

0 commit comments

Comments
 (0)