Skip to content

Commit 5f4292d

Browse files
committed
Added #if #endif to cover changes in query in net6
1 parent 258934d commit 5f4292d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Test/UnitTests/TestDataLayer/TestOptionsWithLogTo.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void TestEfCoreLoggingCheckOnlyShowTheseEvents()
128128

129129
//VERIFY
130130
logs.Count.ShouldEqual(1);
131-
logs.Single().ShouldStartWith("Entity Framework Core 6.0.0-rc.2.21480.5 initialized 'BookContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite");
131+
logs.Single().ShouldStartWith("Entity Framework Core");
132132
}
133133

134134
[Fact]
@@ -236,7 +236,11 @@ public void TestCreateUniqueClassOptionsWithLogTo()
236236
var lines = logs.Last().Split('\n').Select(x => x.Trim()).ToArray();
237237
lines[1].ShouldEqual("SELECT TOP(1) [b].[BookId]");
238238
lines[2].ShouldEqual("FROM [Books] AS [b]");
239+
#if NET6_0_OR_GREATER
239240
lines[3].ShouldEqual("WHERE ([b].[SoftDeleted] = CAST(0 AS bit)) AND ((");
241+
#elif NETCOREAPP3_1
242+
lines[3].ShouldEqual("WHERE ([b].[SoftDeleted] <> CAST(1 AS bit)) AND ((");
243+
#endif
240244
lines[4].ShouldEqual("SELECT COUNT(*)");
241245
lines[5].ShouldEqual("FROM [Review] AS [r]");
242246
lines[6].ShouldEqual("WHERE [b].[BookId] = [r].[BookId]) > 1)");
@@ -259,7 +263,11 @@ public void TestCreateUniqueMethodOptionsWithLogTo()
259263
var lines = logs.Last().Split('\n').Select(x => x.Trim()).ToArray();
260264
lines[1].ShouldEqual("SELECT TOP(1) [b].[BookId]");
261265
lines[2].ShouldEqual("FROM [Books] AS [b]");
266+
#if NET6_0_OR_GREATER
262267
lines[3].ShouldEqual("WHERE ([b].[SoftDeleted] = CAST(0 AS bit)) AND ((");
268+
#elif NETCOREAPP3_1
269+
lines[3].ShouldEqual("WHERE ([b].[SoftDeleted] <> CAST(1 AS bit)) AND ((");
270+
#endif
263271
lines[4].ShouldEqual("SELECT COUNT(*)");
264272
lines[5].ShouldEqual("FROM [Review] AS [r]");
265273
lines[6].ShouldEqual("WHERE [b].[BookId] = [r].[BookId]) > 1)");

0 commit comments

Comments
 (0)