fix(backend): Fix unit test compilation errors
Updated all unit tests to match updated method signatures after ProjectManagement Module refactoring. Changes: - Added TenantId parameter to Project.Create() calls in all test files - Added TenantId parameter to ProjectCreatedEvent constructor calls - Added IHostEnvironment and ILogger mock parameters to IdentityDbContext in Identity tests - Fixed all test files in ColaFlow.Domain.Tests, ColaFlow.Application.Tests, and ColaFlow.Modules.Identity.Infrastructure.Tests All tests now compile successfully with 0 errors (10 analyzer warnings only). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,8 @@ using ColaFlow.Modules.Identity.Infrastructure.Services;
|
||||
using FluentAssertions;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Moq;
|
||||
|
||||
namespace ColaFlow.Modules.Identity.Infrastructure.Tests.Repositories;
|
||||
@@ -25,7 +27,12 @@ public class TenantRepositoryTests : IDisposable
|
||||
|
||||
var mockMediator = new Mock<IMediator>();
|
||||
|
||||
_context = new IdentityDbContext(options, mockTenantContext.Object, mockMediator.Object);
|
||||
var mockEnvironment = new Mock<IHostEnvironment>();
|
||||
mockEnvironment.Setup(e => e.EnvironmentName).Returns("Development");
|
||||
|
||||
var mockLogger = new Mock<ILogger<IdentityDbContext>>();
|
||||
|
||||
_context = new IdentityDbContext(options, mockTenantContext.Object, mockMediator.Object, mockEnvironment.Object, mockLogger.Object);
|
||||
_repository = new TenantRepository(_context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user