123456789101112131415161718192021222324 |
- using System;
- using TestUtils.DataAccess;
-
- namespace TestUtils
- {
- public class Tests
- {
- public const string ConnectionString =
- "User ID=dev;Password=dev;Host=localhost;Port=5432;Database=luticate2_utils;Pooling=true;";
-
- public static LuUtilsDbContext GetDataBaseContext()
- {
- return new LuUtilsDbContext(ConnectionString);
- }
-
- public static void TestRealDb(Action<LuUtilsDbContext> func)
- {
- var dbContext = GetDataBaseContext();
- dbContext.Database.BeginTransaction();
- func(dbContext);
- dbContext.Database.RollbackTransaction();
- }
- }
- }
|