Skip to content

Commit 0b19ee8

Browse files
committed
Attempt to plug coverage hole.
1 parent 1ba2839 commit 0b19ee8

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

PSql.Tests/Tests.Unit/SqlErrorHandlingBuilderTests.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void Append_Sql_NotEmpty()
4949
builder.Append("o");
5050

5151
builder.IsEmpty .ShouldBeFalse();
52-
builder.Complete().ShouldNotBeEmpty();
52+
builder.Complete().ShouldBe(ExpectedSingleBatch);
5353
}
5454

5555
[Test]
@@ -62,7 +62,7 @@ public void Append_Sql_NotEmpty_NoWrap()
6262
builder.Append("o");
6363

6464
builder.IsEmpty .ShouldBeFalse();
65-
builder.Complete().ShouldNotBeEmpty();
65+
builder.Complete().ShouldBe(ExpectedSingleBatchNoWrap);
6666
}
6767

6868
[Test]
@@ -219,9 +219,9 @@ public void StartNewBatch_Multiple()
219219
var builder = new SqlErrorHandlingBuilder();
220220

221221
builder.Append("--# NOWRAP" + Environment.NewLine);
222-
builder.Append("foo");
222+
builder.Append("'foo'"); // also tests that quotes are NOT escaped
223223
builder.StartNewBatch();
224-
builder.Append("bar");
224+
builder.Append("'bar'"); // also tests that quotes ARE escaped
225225

226226
builder.IsEmpty .ShouldBeFalse();
227227
builder.Complete().ShouldBe(ExpectedMultipleBatch);
@@ -291,9 +291,8 @@ BEGIN TRY
291291
292292
SET @__sql__ = N'--# NOWRAP
293293
foo';
294-
--# NOWRAP
294+
--# NOWRAP
295295
foo
296-
297296
END TRY
298297
BEGIN CATCH
299298
PRINT N''
@@ -349,10 +348,10 @@ IF RIGHT(@__sql__, 2) != @crlf
349348
BEGIN TRY
350349
351350
SET @__sql__ = N'--# NOWRAP
352-
foo';
351+
''foo''';
353352
--# NOWRAP
354-
foo
355-
SET @__sql__ = N'bar';
353+
'foo'
354+
SET @__sql__ = N'''bar''';
356355
EXEC sp_executesql @__sql__;
357356
358357
END TRY

0 commit comments

Comments
 (0)