This commit reorganizes namespaces from `DigitalData.Core.Abstractions` and `DigitalData.Core.DTO` to `DigitalData.Core.Application.Interfaces` and `DigitalData.Core.Application.DTO`, improving maintainability and clarity.
Updated using directives across multiple files to reflect the new structure, ensuring functionality remains intact.
Project references in `DigitalData.Core.API.csproj` have been consolidated to include the new Application project.
Introduced new classes and interfaces such as `BaseDTO`, `CookieConsentSettings`, `DataResult`, `Notice`, and `Result` to enhance data transfer and service result handling.
Updated `IRepository`, `ICRUDRepository`, and `IEntityMapper` interfaces to facilitate CRUD operations and entity mapping.
Added extension methods in `Extensions.cs` to improve repository usability.
New interfaces for HTTP client services have been added, enhancing external API call handling.
Overall, these changes reflect a significant restructuring aimed at improving organization and preparing for future development.
- Aktualisiert `CreateUserDtoFaker` um `UserCreateDto` anstelle von `UserDto` zu generieren.
- Die Klasse `UserDto` wurde entfernt, da sie nicht mehr benötigt wird.
- Hinzufügen von `UserCreateDto` für die Erstellung von Benutzern, Erweiterung von `UserBase`.
- Einführung von `UserReadDto` zum Lesen von Benutzerdaten, ebenfalls eine Erweiterung von `UserBase`.
- Aktualisierte `User` und `UserDto` Klassen um von einer neuen `UserBase` Klasse zu erben.
- Verschieben der Eigenschaften `Vorname`, `Email` und `Alter` zu `UserBase`.
- Implementierung der überschriebenen Methoden `GetHashCode` und `Equals` sowohl in `User` als auch in `UserDto`, um die Eigenschaften der Basisklasse zu nutzen.
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.
- 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.
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.
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`.
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.
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.
Updated the `Fake` class to introduce flexible methods for generating fake `User` and `UserDto` objects with optional parameters. Removed the static `UserFaker` instance and related properties.
Added a new `DbSet<User>` property to `MockDbContext` for improved management of `User` entities.
Aktualisiert `DigitalData.Core.Tests.csproj`, um `Bogus` zur Erzeugung gefälschter Daten einzuschließen. Fake.cs„ für die Erstellung von gefälschten “User"-Objekten hinzugefügt. MockDbContext" für das Testen von Datenbank-Interaktionen eingeführt. Definierte `User` und `UserDto` Klassen für die Benutzerdarstellung und Datenübertragung.
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.
- Added ServiceFactory class to manage service registrations and service provider creation.
- Implemented a lazy-loaded IServiceProvider to ensure services are only built once.
- Prevent further modifications to the service collection after the service provider is created.
- Added Provide<T>() method to resolve and retrieve services from the service provider.