From ac84097254041fe16d40f10898f9fa5feaf4ad94 Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Wed, 24 Jun 2026 18:57:14 -0700 Subject: [PATCH] test(expense): assert Form990LineCode projection resolves Co-Authored-By: Claude Sonnet 4.6 --- .../Services/ExpenseCategoryServiceTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/API/ROLAC.API.Tests/Services/ExpenseCategoryServiceTests.cs b/API/ROLAC.API.Tests/Services/ExpenseCategoryServiceTests.cs index 9303b46..c5b6367 100644 --- a/API/ROLAC.API.Tests/Services/ExpenseCategoryServiceTests.cs +++ b/API/ROLAC.API.Tests/Services/ExpenseCategoryServiceTests.cs @@ -63,15 +63,18 @@ public class ExpenseCategoryServiceTests public async Task CreateAndGet_RoundTrips_Form990LineId() { using var db = BuildDb(); + db.Form990ExpenseLines.Add(new ROLAC.API.Entities.Form990ExpenseLine { Id = 1, LineCode = "24", Name_en = "Other" }); db.Form990ExpenseLines.Add(new ROLAC.API.Entities.Form990ExpenseLine { Id = 7, LineCode = "7", Name_en = "Salaries" }); await db.SaveChangesAsync(); var svc = new ExpenseCategoryService(db); - var gid = await svc.CreateGroupAsync(new CreateExpenseGroupRequest { Name_en = "Personnel", Form990LineId = 24 }); + var gid = await svc.CreateGroupAsync(new CreateExpenseGroupRequest { Name_en = "Personnel", Form990LineId = 1 }); var sid = await svc.CreateSubCategoryAsync(new CreateExpenseSubCategoryRequest { GroupId = gid, Name_en = "Salary & Wages", Form990LineId = 7 }); var all = await svc.GetAllAsync(includeInactive: true); var sub = all.Single(g => g.Id == gid).SubCategories.Single(s => s.Id == sid); Assert.Equal(7, sub.Form990LineId); - Assert.Equal(24, all.Single(g => g.Id == gid).Form990LineId); + Assert.Equal("7", sub.Form990LineCode); + Assert.Equal(1, all.Single(g => g.Id == gid).Form990LineId); + Assert.Equal("24", all.Single(g => g.Id == gid).Form990LineCode); } }