選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Tests.cs 630B

1234567891011121314151617181920212223
  1. using System;
  2. using Test.Utils.DataAccess;
  3. namespace Test.Utils
  4. {
  5. public class Tests
  6. {
  7. public static LuUtilsDbContext GetDataBaseContext()
  8. {
  9. return
  10. new LuUtilsDbContext(
  11. "User ID=dev;Password=dev;Host=localhost;Port=5432;Database=luticate2_utils;Pooling=true;");
  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. }