Skip to content

Commit de0e00e

Browse files
committed
Added assert for verifying contexts connections and instances.
1 parent db78c16 commit de0e00e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

NorthwindCRUD.Tests/BaseFixture.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ public class BaseFixture
1818
public void Initialize()
1919
{
2020
DataContext context = GetInMemoryDatabaseContext();
21-
DataHelper = new DataHelper(context);
2221
DataContext context2 = GetInMemoryDatabaseContext();
22+
Assert.AreNotEqual(context.GetHashCode(), context2.GetHashCode(), "Contexts instances should be different.");
23+
Assert.AreEqual(context.Database.GetDbConnection(), context2.Database.GetDbConnection(), "Contexts instances should have the same database connection.");
24+
25+
DataHelper = new DataHelper(context);
2326
DataHelper2 = new DataHelper(context2);
2427
}
2528

0 commit comments

Comments
 (0)