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.

Tests.cs 717B

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