public void Can_regress_ledger_period() { var testCoa = this.GetTestChartOfAccounts(1); _chartOfAccountsService.RegressLedgerPeriod(testCoa.Id); _mockRepo.Verify(x => x.Save(), Times.Once); }
public IActionResult RegressPeriod(int id) { try { _chartOfAccountsService.RegressLedgerPeriod(id); var coa = _chartOfAccountsService.GetChartOfAccountsById(id); return(new JsonResult(coa.CurrentLedgerPeriodStartDate.ToString("dd-MM-yyyy"))); } catch (Exception) { // return the error. return(BadRequest(new { Error = "An error occured while regressing period." })); } }