using Microsoft.EntityFrameworkCore;
using MoneyMap.Data;
namespace MoneyMap.Tests.TestHelpers;
public static class DbContextHelper
{
///
/// Creates an in-memory database context for testing.
/// Each call creates a unique database to ensure test isolation.
///
public static MoneyMapContext CreateInMemoryContext()
{
var options = new DbContextOptionsBuilder()
.UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
.Options;
return new MoneyMapContext(options);
}
}