- Parameter `useRealDb` zur Methode `CreateHost` hinzugefügt, um zwischen In-Memory- und echter Datenbank zu wechseln. - `Microsoft.EntityFrameworkCore` für die Datenbankkonfiguration integriert. - SQL Server-Verbindung konfiguriert, wenn `useRealDb` auf `true` gesetzt ist, ansonsten wird standardmäßig eine In-Memory-Datenbank verwendet.
23 lines
386 B
C#
23 lines
386 B
C#
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace EnvelopeGenerator.Tests.Application.Services;
|
|
|
|
[TestFixture]
|
|
public class DocumentStatusServiceTests
|
|
{
|
|
private IHost _host;
|
|
|
|
[SetUp]
|
|
public void SetUp()
|
|
{
|
|
_host = Mock.CreateHost(useRealDb: true);
|
|
}
|
|
|
|
[TearDown]
|
|
public void TearDown()
|
|
{
|
|
_host.StopAsync();
|
|
_host.Dispose();
|
|
}
|
|
}
|