From e752c6f6ab7ee4e8756a5b53a2364a52fced6ef7 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 17 Apr 2025 15:17:57 +0200 Subject: [PATCH] Add AutoMapper setup to DbRepositoryTests This commit introduces a using directive for `System.Reflection` in `DbRepositoryTests.cs` to support reflection features. The `Setup` method is updated to include `AddAutoMapper`, ensuring AutoMapper services are registered for dependency injection in the test environment. --- DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs b/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs index 0e2f643..e63ded3 100644 --- a/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs +++ b/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs @@ -1,15 +1,17 @@ namespace DigitalData.Core.Tests.Infrastructure; +using Bogus; using DigitalData.Core.Infrastructure; using DigitalData.Core.Tests.Mock; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using System.Reflection; public class DbRepositoryTests { private IHost _host; - + [SetUp] public void Setup() { @@ -19,6 +21,8 @@ public class DbRepositoryTests builder.Services.AddDbRepository(context => context.Users); + builder.Services.AddAutoMapper(Assembly.GetExecutingAssembly()); + _host = builder.Build(); }