From 4e12e9f8f1468aaaad5b51152cba09ebb2c5f798 Mon Sep 17 00:00:00 2001 From: DeepnaPooja Date: Sun, 30 Aug 2026 22:45:43 +0530 Subject: [PATCH] Update RegionServiceTests for the new RegionService constructor RegionService now depends on ICurrentUserService and IScopeAccessService for the target/budget/tax-rule/agency scope checks; update the existing CRUD test setup to mock them accordingly. Co-Authored-By: Claude Sonnet 5 --- Distribution.Tests/Services/RegionServiceTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Distribution.Tests/Services/RegionServiceTests.cs b/Distribution.Tests/Services/RegionServiceTests.cs index 0b384cd..358cca7 100644 --- a/Distribution.Tests/Services/RegionServiceTests.cs +++ b/Distribution.Tests/Services/RegionServiceTests.cs @@ -1,4 +1,5 @@ using Distribution.Features.Region; +using Distribution.Infra.Authorization; using Distribution.Infra.UoW; using Distribution.Models; using Moq; @@ -10,11 +11,14 @@ public class RegionServiceTests { private readonly Mock _repo = new(); private readonly Mock _uow = new(); + private readonly Mock _currentUser = new(); + private readonly Mock _scopeAccess = new(); private readonly RegionService _sut; public RegionServiceTests() { - _sut = new RegionService(_repo.Object, _uow.Object); + _currentUser.Setup(u => u.RoleLevel).Returns(60); + _sut = new RegionService(_repo.Object, _uow.Object, _currentUser.Object, _scopeAccess.Object); } private static Region ActiveRegion(string name = "North") =>