10 Commits

Author SHA1 Message Date
Developer 02
f1f5b9e16d refactor(DbRepositoryTests): Update AddDbRepository configuration 2025-04-22 16:32:17 +02:00
Developer 02
85787e7054 feat(DbRepositoryTests): ReadAsync_ShouldReturnUpdated und ReadAsync_ShouldNotReturnDeleted Tests 2025-04-22 10:09:47 +02:00
Developer 02
c955220310 feat (Mapping): Porfile hinzufügen 2025-04-22 09:53:20 +02:00
Developer 02
3a604ede88 Refactor user creation and retrieval in tests
Updated `DbRepositoryTests` to await `CreateAsync` directly for user creation. Changed assertion to compare the created user with the user retrieved from the repository, enhancing test accuracy.
2025-04-17 16:43:15 +02:00
Developer 02
9376fcff86 Enhance IRepository and update DbRepositoryTests
- Added ReadAsync method to IRepository for user retrieval.
- Introduced _userRepo field in DbRepositoryTests for better clarity.
- Modified Setup method to initialize _userRepo from the service provider.
- Updated CreateAsync_ShouldNotThrow to use _userRepo.
- Added ReadAsync_ShouldReturnCreated test for user retrieval validation.
2025-04-17 16:00:59 +02:00
Developer 02
06df97597e Refactor user creation tests in DbRepositoryTests
Die Testmethode `CreateAsync_ShouldPersistUser` wurde entfernt und `CreateAsync_ShouldNotThrow` mit Testfällen für die Erstellung einzelner und mehrerer Benutzer hinzugefügt. Die neue Methode prüft, dass `CreateAsync` keine Ausnahmen auslöst, während Benutzerdaten mit einem Faker erzeugt werden.
2025-04-17 15:48:06 +02:00
Developer 02
266d03e0a1 Add user creation test to DbRepositoryTests
This commit introduces a new test method `CreateAsync_ShouldPersistUser` in `DbRepositoryTests.cs`. The method tests the asynchronous creation of a user in the repository using the `Faker` library to generate user data. It asserts that no exceptions are thrown during the creation process. Additionally, the using directives have been updated to include `DigitalData.Core.Abstractions.Infrastructure`.
2025-04-17 15:31:37 +02:00
Developer 02
e752c6f6ab 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.
2025-04-17 15:17:57 +02:00
Developer 02
561a751de4 Update dependency injection and repository tests
Modified `AddDbRepository` method to allow broader entity types and registered `queryFactory` as a singleton. Added necessary using directives in `DbRepositoryTests.cs` and updated the `Setup` method to configure an in-memory database for testing with `MockDbContext` and `User` entity.
2025-04-17 15:05:23 +02:00
Developer 02
52f6dc161e Add EF Core package references and DbRepositoryTests
Updated `DigitalData.Core.Tests.csproj` to include conditional
package references for Entity Framework Core and its InMemory
provider for net7.0, net8.0, and net9.0.

Added `DbRepositoryTests` class with setup and teardown
methods for managing the lifecycle of a host instance.
2025-04-17 13:54:25 +02:00