You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324
  1. using System;
  2. using Test.Utils.DataAccess;
  3. namespace Test.Utils
  4. {
  5. public class Tests
  6. {
  7. public const string ConnectionString =
  8. "User ID=dev;Password=dev;Host=localhost;Port=5432;Database=luticate2_utils;Pooling=true;";
  9. public static LuUtilsDbContext GetDataBaseContext()
  10. {
  11. return new LuUtilsDbContext(ConnectionString);
  12. }
  13. public static void TestRealDb(Action<LuUtilsDbContext> func)
  14. {
  15. var dbContext = GetDataBaseContext();
  16. dbContext.Database.BeginTransaction();
  17. func(dbContext);
  18. dbContext.Database.RollbackTransaction();
  19. }
  20. }
  21. }