Adds Data Access Layer integration tests

This commit is contained in:
BinaryAlley committed 2024-08-28 21:51:57 +03:00
1 parent a2721e39cb
commit a3011297ca
3 files changed
+94

No files matched your search

@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.DataAccess.Core.Repositories.Common.Factory;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.DataAccess.IntegrationTests.Core.Repositories.Common.Factory;
/// <summary>
/// Contains integration tests for the <see cref="RepositoryFactory"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public class RepositoryFactoryTests
{
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void RepositoryFactoryImplementsRepositoryFactoryInterface_InterfaceIsImplemented_ReturnsTrue()
{
// Arrange
var repositoryFactory = new RepositoryFactory(null!);
// Assert
Assert.True(repositoryFactory is IRepositoryFactory);
}
#endregion
}
@@ -0,0 +1,32 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.DataAccess.Common.DependencyInjection;
using Lumina.DataAccess.Core.UoW;
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.DataAccess.IntegrationTests.Core.UoW;
/// <summary>
/// Contains integration tests for the <see cref="UnitOfWork"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public class UnitOfWorkTests
{
#region ===================================================================== METHODS ===================================================================================
[Fact]
public void UnitOfWorkImplementsUnitOfWorkInterface_InterfaceIsImplemented_ReturnsTrue()
{
// Arrange
var services = new ServiceCollection();
DataAccessLayerServices.AddDataAccessLayerServices(services);
var serviceProvider = services.BuildServiceProvider();
var unitOfWork = (UnitOfWork)serviceProvider.GetRequiredService<IUnitOfWork>();
// Assert
Assert.True(unitOfWork is IUnitOfWork);
}
#endregion
}