public async Task Should_Success_Delete_Approval_Non_PO() { CashierApprovalService service = new CashierApprovalService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); VbRequestModel model = await _dataUtil(service).GetTestData(); CashierApprovalViewModel data = new CashierApprovalViewModel() { VBRequestCategory = "NONPO", CashierApproval = new List <CashierApprovalItemViewModel>() { new CashierApprovalItemViewModel() { VBNo = model.VBNo, Id = model.Id } } }; var acceptedResponse = await service.CashierAproval(data); var newModel = await service.ReadByIdAsync(model.Id); var deleteResponse = await service.DeleteCashierAproval(newModel.Id); Assert.NotEqual(0, deleteResponse); }
public async Task Should_Fail_Post_Approval_Non_PO() { CashierApprovalService service = new CashierApprovalService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); VbRequestModel model = await _dataUtil(service).GetTestData(); CashierApprovalViewModel data = new CashierApprovalViewModel() { VBRequestCategory = "NONPO", CashierApproval = new List <CashierApprovalItemViewModel>() { new CashierApprovalItemViewModel() { VBNo = model.VBNo, Id = model.Id } } }; await Assert.ThrowsAnyAsync <Exception>(() => service.CashierAproval(null)); }
public async Task Should_Success_Post_Approval_With_PO() { CashierApprovalService service = new CashierApprovalService(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); VbRequestModel model = await _dataUtil(service).GetTestData(); CashierApprovalViewModel data = new CashierApprovalViewModel() { VBRequestCategory = "PO", CashierApproval = new List <CashierApprovalItemViewModel>() { new CashierApprovalItemViewModel() { VBNo = model.VBNo, Id = model.Id, Amount = model.Amount, } } }; var response = await service.CashierAproval(data); Assert.NotEqual(0, response); }