Add project reference for TeleWave.Infrastructure: include TeleWave.Infrastructure.csproj in TeleWave.Application.Tests project to support additional testing capabilities.

This commit is contained in:
Leonid Pershin
2026-07-25 20:12:04 +03:00
parent ed240ef73c
commit 4611f90d11
18 changed files with 2027 additions and 0 deletions
@@ -0,0 +1,17 @@
using Microsoft.EntityFrameworkCore;
using TeleWave.Infrastructure.Persistence;
namespace TeleWave.Application.Tests.Support;
/// <summary>
/// Общий InMemory-стенд поверх реального <see cref="AppDbContext"/> (с настоящими EF-конфигурациями).
/// Каждый экземпляр — своя изолированная БД; <see cref="New"/> отдаёт новый контекст на ту же БД,
/// чтобы можно было перечитать сохранённое свежим контекстом.
/// </summary>
internal sealed class TestDb
{
private readonly string _name = $"tw-{Guid.NewGuid():N}";
public AppDbContext New() =>
new(new DbContextOptionsBuilder<AppDbContext>().UseInMemoryDatabase(_name).Options);
}