Чето поменял
This commit is contained in:
		| @@ -1,19 +1,19 @@ | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Infrastructure.Database; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Diagnostics; | ||||
| using DbContext = Infrastructure.Database.DbContext; | ||||
|  | ||||
| namespace VisaApi.Tests.Infrastructure.Database; | ||||
|  | ||||
| public static class InMemoryContextProvider | ||||
| { | ||||
|     private static DbContextOptions<DbContext> opts = new DbContextOptionsBuilder<DbContext>() | ||||
|     private static DbContextOptions<DatabaseContext> opts = new DbContextOptionsBuilder<DatabaseContext>() | ||||
|         .UseInMemoryDatabase("VisaApiDB") | ||||
|         .ConfigureWarnings(b => b.Ignore(InMemoryEventId.TransactionIgnoredWarning)) | ||||
|         .Options; | ||||
|  | ||||
|     public static DbContext GetDbContext() | ||||
|     public static DatabaseContext GetDbContext() | ||||
|     { | ||||
|             var result = new DbContext(opts); | ||||
|             var result = new DatabaseContext(opts); | ||||
|  | ||||
|             result.Database.EnsureDeleted(); | ||||
|             result.Database.EnsureCreated(); | ||||
|   | ||||
| @@ -20,7 +20,7 @@ public class ApplicantsRepositoryTests | ||||
|     /// <summary> Returns <see cref="IApplicantsRepository"/> </summary> | ||||
|     /// <param name="context"> Database context </param> | ||||
|     /// <returns>Repository</returns> | ||||
|     private static IApplicantsRepository GetRepository(DbContext context) | ||||
|     private static IApplicantsRepository GetRepository(DatabaseContext context) | ||||
|         => new ApplicantsRepository(context, context); | ||||
|  | ||||
|     /// <summary> Returns <see cref="IDateTimeProvider"/> </summary> | ||||
|   | ||||
| @@ -13,7 +13,7 @@ public class GenericRepositoryTests | ||||
|     /// <summary> Returns <see cref="GenericRepository{T}"/> </summary> | ||||
|     /// <param name="context"> Database context </param> | ||||
|     /// <returns>Repository</returns> | ||||
|     private static GenericRepository<User> GetRepository(DbContext context) => new TestGenericRepository(context, context); | ||||
|     private static GenericRepository<User> GetRepository(DatabaseContext context) => new TestGenericRepository(context, context); | ||||
|  | ||||
|     /// <summary> Test for <see cref="GenericRepository{T}.GetAllAsync"/> method that should return empty collection if nothing added </summary> | ||||
|     [Fact] | ||||
|   | ||||
| @@ -17,7 +17,7 @@ public class UsersRepositoryTests | ||||
|     /// <summary> Returns <see cref="IVisaApplicationsRepository"/> </summary> | ||||
|     /// <param name="context"> Database context </param> | ||||
|     /// <returns>Repository</returns> | ||||
|     private static IUsersRepository GetRepository(DbContext context) | ||||
|     private static IUsersRepository GetRepository(DatabaseContext context) | ||||
|         => new UsersRepository(context, context); | ||||
|  | ||||
|     /// <summary> | ||||
|   | ||||
| @@ -23,7 +23,7 @@ public class VisaApplicationsRepositoryTests | ||||
|     /// <summary> Returns <see cref="IVisaApplicationsRepository"/> </summary> | ||||
|     /// <param name="context"> Database context </param> | ||||
|     /// <returns>Repository</returns> | ||||
|     private static IVisaApplicationsRepository GetRepository(DbContext context) | ||||
|     private static IVisaApplicationsRepository GetRepository(DatabaseContext context) | ||||
|         => new VisaApplicationsRepository(context, context); | ||||
|  | ||||
|     /// <summary> Returns <see cref="IDateTimeProvider"/> </summary> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user