fixers 10/22
This commit is contained in:
@@ -16,9 +16,7 @@ namespace ERPCore.Tests;
|
||||
public class CustomerFieldSwitchTests
|
||||
{
|
||||
private static CustomerService Svc(ErpDbContext db) =>
|
||||
new(new Repository<Customer>(db), new Repository<Warehouse>(db), new FakeBranchConfig(),
|
||||
new Repository<SalesConfig>(db), new Repository<SalesInvoice>(db), new Repository<SalesInvoicePayment>(db),
|
||||
new PassThroughUnitOfWork(db));
|
||||
new(new CustomerRepository(db), new FakeBranchConfig(), new PassThroughUnitOfWork(db));
|
||||
|
||||
private static async Task SwitchesAsync(ErpDbContext db, Action<SalesConfig> tweak)
|
||||
{
|
||||
|
||||
@@ -237,13 +237,8 @@ public class DayEndReportServiceTests
|
||||
.Build();
|
||||
var clock = new BusinessDayClock(config);
|
||||
var branch = new CurrentBranchContext(new TestCurrentUser());
|
||||
var cash = new CashInHandService(
|
||||
new Repository<SalesSlip>(db), new Repository<BundleSale>(db), new Repository<SalesInvoicePayment>(db),
|
||||
new Repository<ExpensePayment>(db), new Repository<BankDeposit>(db), branch, clock, config);
|
||||
return new DayEndReportService(
|
||||
new Repository<SalesSlip>(db), new Repository<BundleSale>(db), new Repository<SalesInvoice>(db),
|
||||
new Repository<SalesInvoicePayment>(db), new Repository<StockLedger>(db),
|
||||
new Repository<Expense>(db), new Repository<BankDeposit>(db), cash, branch, clock);
|
||||
var cash = new CashInHandService(new CashInHandRepository(db), branch, clock, config);
|
||||
return new DayEndReportService(new DayEndReportRepository(db), cash, branch, clock);
|
||||
}
|
||||
|
||||
private static ErpDbContext CreateContext()
|
||||
|
||||
@@ -396,10 +396,7 @@ public class DualApprovalTests
|
||||
(GlAccountRole.InventoryLoss, "5900")),
|
||||
new SerialTrackingService(new Repository<Serial>(db), new Repository<SerialMovement>(db), new Repository<StockLayer>(db),
|
||||
new Repository<ProductConfig>(db), user));
|
||||
var prices = new PriceAdjustmentService(
|
||||
new Repository<PriceAdjustment>(db), new Repository<PriceAdjustmentLine>(db), new Repository<Item>(db),
|
||||
new Repository<ItemPriceHistory>(db), new Repository<User>(db), new Repository<ApprovalConfig>(db),
|
||||
approvals, notifications, numbers, user, uow);
|
||||
var prices = new PriceAdjustmentService(new PriceAdjustmentRepository(db), approvals, notifications, numbers, user, uow);
|
||||
|
||||
return new Harness { Db = db, User = user, Mutator = mutator, Gl = gl, Notifications = notifications, Stock = stock, Prices = prices };
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ProcurementAndOpeningBalanceTests
|
||||
}
|
||||
|
||||
private static ProcurementConfigService ConfigService(ErpDbContext db) =>
|
||||
new(new Repository<ProcurementConfig>(db), new TestCurrentUser(), new PassThroughUnitOfWork(db));
|
||||
new(new ProcurementConfigRepository(db), new TestCurrentUser(), new PassThroughUnitOfWork(db));
|
||||
|
||||
private static VendorService VendorSvc(ErpDbContext db) =>
|
||||
new(new Repository<Vendor>(db), new FakeBranchConfig(), ConfigService(db), new PassThroughUnitOfWork(db));
|
||||
@@ -214,8 +214,7 @@ public class ProcurementAndOpeningBalanceTests
|
||||
// ---------------------------------------------------------------- purchase-order tax
|
||||
|
||||
private static PurchaseOrderService PoSvc(ErpDbContext db) =>
|
||||
new(new Repository<PurchaseOrder>(db), new Repository<Vendor>(db), new Repository<Requisition>(db),
|
||||
new Repository<Item>(db), new Repository<Uom>(db), new Repository<Warehouse>(db),
|
||||
new(new PurchaseOrderRepository(db),
|
||||
new FakeNumberSequence(), new TestCurrentUser(), new NullNotifications(), new FakeBranchConfig(),
|
||||
ConfigService(db), new PassThroughUnitOfWork(db));
|
||||
|
||||
@@ -561,9 +560,7 @@ public class ProcurementAndOpeningBalanceTests
|
||||
var fifo = new FifoCostingService(
|
||||
new Repository<StockLayer>(db), new Repository<StockLedger>(db), new Repository<JournalEntryStub>(db), db, gl, glAccounts);
|
||||
return new OpeningStockService(
|
||||
new Repository<OpeningBalanceRun>(db), new Repository<Item>(db), new Repository<Warehouse>(db),
|
||||
new Repository<StockLedger>(db), new Repository<JournalEntryStub>(db), fifo, gl, glAccounts,
|
||||
new TestCurrentUser(), new PassThroughUnitOfWork(db));
|
||||
new OpeningStockRepository(db), fifo, gl, glAccounts, new TestCurrentUser(), new PassThroughUnitOfWork(db));
|
||||
}
|
||||
|
||||
private static Item StockedItem(int id, Action<Item>? tweak = null)
|
||||
|
||||
@@ -145,9 +145,7 @@ internal static class BankDepositTestSupport
|
||||
}
|
||||
|
||||
public static CashInHandService CashService(ErpDbContext db, DateOnly? trackingStart)
|
||||
=> new(new Repository<SalesSlip>(db), new Repository<BundleSale>(db), new Repository<SalesInvoicePayment>(db),
|
||||
new Repository<ExpensePayment>(db), new Repository<BankDeposit>(db),
|
||||
new CurrentBranchContext(new TestCurrentUser()), Clock, Config(trackingStart));
|
||||
=> new(new CashInHandRepository(db), new CurrentBranchContext(new TestCurrentUser()), Clock, Config(trackingStart));
|
||||
|
||||
public static BankDepositService DepositService(ErpDbContext db, DateOnly? trackingStart, FakeGeneralLedger gl)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user