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); } }