public void CreateInvoice_with_invalid_amount()
        {
            var testClass = new InvoiceServices(_invoiceRepository.Object,
                                                _customerService.Object,
                                                _companyService.Object);

            testClass.CreateInvoice(1, 1, -1);
        }
Exemplo n.º 2
0
        public ActionResult NewVehicle(NewInvoiceModel invoice)
        {
            if (ModelState.IsValid)
            {
                var newInvoice = InvoiceServices.CreateInvoice(invoice, base.LocationId);
                NavigationServices.AddVehicleToInShopList(base.LocationId, newInvoice);
                return(RedirectToAction("GetInvoice", new { id = newInvoice.Id }));
            }

            // Invalid - redisplay with errors
            ViewBag.AccountTypes = AccountTypeServices.GetAccountTypes(false, invoice.AccountTypeId);

            return(View("NewVehicle", invoice));
        }
Exemplo n.º 3
0
        public async Task <ActionResult <Invoice> > PostInvoice([FromBody] InvoiceRequest data)
        {
            var result = await _service.CreateInvoice(data);

            return(result);
        }